예제 #1
0
        public async Task AddOrUpdateRange()
        {
            using (var httpTest = new HttpTest())
            {
                // Response
                httpTest.RespondWithJson(new[] {
                    new { Id = "111", Ok = true, Rev = "111" },
                    new { Id = "222", Ok = true, Rev = "222" },
                });
                // Logout
                httpTest.RespondWithJson(new { ok = true });

                var moreRebels = new[] {
                    new Rebel {
                        Name = "Luke", Id = "1"
                    },
                    new Rebel {
                        Name = "Leia", Id = "2"
                    }
                };
                var newR = await _rebels.CreateOrUpdateRangeAsync(moreRebels);

                httpTest
                .ShouldHaveCalled("http://localhost/rebels/_bulk_docs")
                .WithVerb(HttpMethod.Post);
            }
        }