Ejemplo n.º 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.AddOrUpdateRangeAsync(moreRebels);

            httpTest
            .ShouldHaveCalled("http://localhost/rebels/_bulk_docs")
            .WithVerb(HttpMethod.Post);
        }
Ejemplo n.º 2
0
        private async Task ArrangeAsync()
        {
            var roles = new CouchDbUser[]
            {
                new() { UserName = "******" },
                new() { UserName = "******" }
            };

            await _db.AddOrUpdateRangeAsync(roles, default);
        }
Ejemplo n.º 3
0
        private async Task ArrangeAsync()
        {
            var guid  = Guid.NewGuid();
            var roles = new CouchDbRole[]
            {
                new() { Name = $"{guid}_1" },
                new() { Name = $"{guid}_2" }
            };

            await _db.AddOrUpdateRangeAsync(roles, default);
        }