Skip to content

Commit 3216f17

Browse files
committed
Tests to show explicit bool comparison behavior
1 parent a6ea0d1 commit 3216f17

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

tests/CouchDB.Driver.UnitTests/Find/Find_Selector.cs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,5 +86,17 @@ public void Variable_Bool_False()
8686
var json = rebels.Where(r => !r.IsJedi).OrderBy(r => r.IsJedi).ToString();
8787
Assert.Equal(@"{""selector"":{""isJedi"":false},""sort"":[""isJedi""]}", json);
8888
}
89+
[Fact]
90+
public void Variable_Bool_ExplicitTrue()
91+
{
92+
var json = rebels.Where(r => r.IsJedi == true).OrderBy(r => r.IsJedi).ToString();
93+
Assert.Equal(@"{""selector"":{""isJedi"":true},""sort"":[""isJedi""]}", json);
94+
}
95+
[Fact]
96+
public void Variable_Bool_ExplicitFalse()
97+
{
98+
var json = rebels.Where(r => r.IsJedi == false).OrderBy(r => r.IsJedi).ToString();
99+
Assert.Equal(@"{""selector"":{""isJedi"":false},""sort"":[""isJedi""]}", json);
100+
}
89101
}
90102
}

0 commit comments

Comments
 (0)