Skip to content

Commit bee2740

Browse files
committed
Add test for bit parameters
1 parent ce6205c commit bee2740

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

tests/MiniProfiler.Tests/SqlFormatterTests.cs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,24 @@ public void TableQueryWithTwoParameters(string at)
217217

218218
#region Single data type tests
219219

220+
[Theory]
221+
[MemberData(nameof(GetParamPrefixes))]
222+
public void TableQueryWithBit(string at)
223+
{
224+
// arrange
225+
_commandText = "select 1 from dbo.Table where x = @x, y = @y";
226+
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;";
227+
CreateDbCommand(CommandType.Text);
228+
AddDbParameter<bool?>(at + "x", true, type: DbType.Boolean);
229+
AddDbParameter<bool?>(at + "y", null, type: DbType.Boolean);
230+
231+
// act
232+
var actualOutput = GenerateOutput();
233+
234+
// assert
235+
Assert.Equal(expectedOutput, actualOutput);
236+
}
237+
220238
[Theory]
221239
[MemberData(nameof(GetParamPrefixes))]
222240
public void TableQueryWithVarchar(string at)

0 commit comments

Comments
 (0)