Skip to content

Commit

Permalink
Add test for bit parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
NickCraver committed Aug 23, 2018
1 parent ce6205c commit bee2740
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions tests/MiniProfiler.Tests/SqlFormatterTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<bool?>(at + "x", true, type: DbType.Boolean);
AddDbParameter<bool?>(at + "y", null, type: DbType.Boolean);

// act
var actualOutput = GenerateOutput();

// assert
Assert.Equal(expectedOutput, actualOutput);
}

[Theory]
[MemberData(nameof(GetParamPrefixes))]
public void TableQueryWithVarchar(string at)
Expand Down

0 comments on commit bee2740

Please sign in to comment.