File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed
tests/CouchDB.Driver.UnitTests Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,24 @@ public async Task FindWithConflicts()
4949 }
5050 }
5151 [ Fact ]
52+ public async Task Query ( )
53+ {
54+ using ( var httpTest = new HttpTest ( ) )
55+ {
56+ var expected = new List < Rebel > ( ) { new Rebel { Id = "aoeuidhtns" } } ;
57+ httpTest . RespondWithJson ( new { Docs = expected } ) ;
58+
59+ var query = new { selector = new { age = 19 } } ;
60+ var result = await _rebels . QueryAsync ( query ) ;
61+ httpTest
62+ . ShouldHaveCalled ( "http://localhost/rebels/_find" )
63+ . WithVerb ( HttpMethod . Post )
64+ . WithRequestBody ( @"{""selector"":{""age"":19}}" ) ;
65+ Assert . Equal ( expected . Count , result . Count ) ;
66+ Assert . Equal ( expected [ 0 ] . Id , result [ 0 ] . Id ) ;
67+ }
68+ }
69+ [ Fact ]
5270 public async Task Create ( )
5371 {
5472 using ( var httpTest = new HttpTest ( ) )
You can’t perform that action at this time.
0 commit comments