Skip to content

Commit b0d09fd

Browse files
committed
Added bool test for issue #282
1 parent b8bd7ff commit b0d09fd

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

src/Nest.Tests.Integration/Integration/Query/TermToString.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,13 +82,25 @@ public void DateTimeToStringTest()
8282
);
8383
this.AssertTermResults(results);
8484
}
85+
86+
[Test]
87+
public void BoolToStringTests()
88+
{
89+
//this should serialize to ISO NOT simply datetime.tostring()!
90+
var results = _client.Search<ElasticSearchProject>(s => s
91+
.Query(q => q
92+
.Term(p => p.BoolValue, _LookFor.BoolValue)
93+
)
94+
);
95+
this.AssertTermResults(results, 7);
96+
}
8597

8698

87-
private void AssertTermResults(IQueryResponse<ElasticSearchProject> results)
99+
private void AssertTermResults(IQueryResponse<ElasticSearchProject> results, int expected = 1)
88100
{
89101
Assert.True(results.IsValid, results.ConnectionStatus.Result);
90102
Assert.True(results.ConnectionStatus.Success, results.ConnectionStatus.Result);
91-
Assert.AreEqual(1, results.Total);
103+
Assert.AreEqual(expected, results.Total);
92104
}
93105
}
94106
}

src/Nest.Tests.Integration/Nest.Tests.Integration.csproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@
9999
<Compile Include="Integration\Filter\MissingExistsFilterTests.cs" />
100100
<Compile Include="Integration\Filter\PrefixFilterTests.cs" />
101101
<Compile Include="Integration\Filter\RangeFilterTests.cs" />
102+
<Compile Include="Integration\Query\TermToString.cs" />
102103
<Compile Include="Integration\Query\TextPhraseQueryTests.cs" />
103104
<Compile Include="Integration\Query\TextPhrasePrefixQueryTests.cs" />
104105
<Compile Include="Integration\Filter\NumericRangeFilterTests.cs" />

0 commit comments

Comments
 (0)