Skip to content

Commit 65acd80

Browse files
committed
Test for FindMany
1 parent c637248 commit 65acd80

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

tests/CouchDB.Driver.UnitTests/Database_Tests.cs

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,31 @@ public async Task FindWithConflicts()
4949
}
5050
}
5151
[Fact]
52+
public async Task FindMany()
53+
{
54+
using (var httpTest = new HttpTest())
55+
{
56+
httpTest.RespondWith(@"{""results"":[{""id"":""1"",""docs"":[{""ok"":{""_id"":""1"",""Name"":""Luke""}}]},{""id"":""2"",""docs"":[{""ok"":{""_id"":""2"",""Name"":""Leia""}}]}]}");
57+
var ids = new string[] { "1", "2" };
58+
var result = await _rebels.FindManyAsync(ids);
59+
httpTest
60+
.ShouldHaveCalled("http://localhost/rebels/_bulk_get")
61+
.WithRequestJson(new
62+
{
63+
docs = new[]
64+
{
65+
new { id = "1" },
66+
new { id = "2" },
67+
}
68+
})
69+
.WithVerb(HttpMethod.Post);
70+
71+
Assert.Equal(2, result.Count);
72+
Assert.Equal("Luke", result[0].Name);
73+
Assert.Equal("Leia", result[1].Name);
74+
}
75+
}
76+
[Fact]
5277
public async Task Create()
5378
{
5479
using (var httpTest = new HttpTest())

0 commit comments

Comments
 (0)