From bee27404babe793ffc8bd6171dcec44aef65b496 Mon Sep 17 00:00:00 2001 From: Nick Craver Date: Thu, 23 Aug 2018 18:45:38 -0400 Subject: [PATCH] Add test for bit parameters --- tests/MiniProfiler.Tests/SqlFormatterTests.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/MiniProfiler.Tests/SqlFormatterTests.cs b/tests/MiniProfiler.Tests/SqlFormatterTests.cs index 387083b75..a3de4aa38 100644 --- a/tests/MiniProfiler.Tests/SqlFormatterTests.cs +++ b/tests/MiniProfiler.Tests/SqlFormatterTests.cs @@ -217,6 +217,24 @@ public void TableQueryWithTwoParameters(string at) #region Single data type tests + [Theory] + [MemberData(nameof(GetParamPrefixes))] + public void TableQueryWithBit(string at) + { + // arrange + _commandText = "select 1 from dbo.Table where x = @x, y = @y"; + const string expectedOutput = "DECLARE @x bit = 1,\r\n @y bit = null;\r\n\r\nselect 1 from dbo.Table where x = @x, y = @y;"; + CreateDbCommand(CommandType.Text); + AddDbParameter(at + "x", true, type: DbType.Boolean); + AddDbParameter(at + "y", null, type: DbType.Boolean); + + // act + var actualOutput = GenerateOutput(); + + // assert + Assert.Equal(expectedOutput, actualOutput); + } + [Theory] [MemberData(nameof(GetParamPrefixes))] public void TableQueryWithVarchar(string at)