File tree Expand file tree Collapse file tree 4 files changed +11
-6
lines changed
src/Tests/Nest.Tests.Integration Expand file tree Collapse file tree 4 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 11using System . Linq ;
22using FluentAssertions ;
3+ using Nest . Tests . MockData ;
34using Nest . Tests . MockData . Domain ;
45using NUnit . Framework ;
56
@@ -24,18 +25,19 @@ public void Missing()
2425
2526 [ Test ]
2627 public void Filter ( )
27- {
28+ {
29+ var lookFor = NestTestData . Data . Select ( p => p . Country ) . First ( ) ;
2830 var results = this . Client . Search < ElasticsearchProject > ( s=> s
2931 . Size ( 0 )
3032 . Aggregations ( a=> a
3133 . Filter ( "filtered_agg" , m=> m
32- . Filter ( f=> f . Term ( p=> p . Country , "Sweden" ) )
34+ . Filter ( f=> f . Term ( p=> p . Country , lookFor ) )
3335 )
3436 )
3537 ) ;
3638 results . IsValid . Should ( ) . BeTrue ( ) ;
3739 var filteredBucket = results . Aggs . Filter ( "filtered_agg" ) ;
38- filteredBucket . DocCount . Should ( ) . BeGreaterThan ( 1 ) ;
40+ filteredBucket . DocCount . Should ( ) . BeGreaterThan ( 0 ) ;
3941 }
4042
4143 [ Test ]
Original file line number Diff line number Diff line change 11using FluentAssertions ;
2+ using Nest . Tests . MockData ;
23using Nest . Tests . MockData . Domain ;
34using NUnit . Framework ;
45using System ;
@@ -24,11 +25,12 @@ public void CountTest()
2425 [ Test ]
2526 public void CountWithQueryTest ( )
2627 {
28+ var lookFor = NestTestData . Data . Select ( p => p . Country ) . First ( ) ;
2729 var response = this . Client . Count < ElasticsearchProject > ( c => c
2830 . Query ( q => q
2931 . Match ( m => m
3032 . OnField ( p => p . Country )
31- . Query ( "Sweden" )
33+ . Query ( lookFor )
3234 )
3335 )
3436 ) ;
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ public void SingleTransformTest()
3232 . Index ( ElasticsearchConfiguration . DefaultIndex )
3333 ) ;
3434
35- getResult . Mapping . Transform . Count . Should ( ) . Be ( 1 ) ;
35+ getResult . Mapping . Transform . Count . Should ( ) . BeGreaterOrEqualTo ( 1 ) ;
3636 }
3737
3838 [ Test ]
Original file line number Diff line number Diff line change 11using System . Linq ;
2+ using FluentAssertions ;
23using Nest . Tests . MockData ;
34using NUnit . Framework ;
45using Nest . Tests . MockData . Domain ;
@@ -41,7 +42,7 @@ public void TestUpdate_ObjectInitializer()
4142 Script = "ctx._source.loc += 10" ,
4243 } ) ;
4344 project = this . Client . Source < ElasticsearchProject > ( s => s . Id ( id ) ) ;
44- Assert . AreEqual ( project . LOC , loc + 10 ) ;
45+ project . LOC . Should ( ) . Be ( loc + 10 ) ;
4546 Assert . AreNotEqual ( project . Version , "1" ) ;
4647 }
4748
You can’t perform that action at this time.
0 commit comments