public async Task Create_Discriminator() { var rebels = _client.GetDatabase <Rebel>(database: "rebels", discriminator: "myRebels"); using var httpTest = new HttpTest(); httpTest.RespondWithJson(new { Id = "xxx", Ok = true, Rev = "xxx" }); var r = new Rebel { Name = "Luke" }; var newR = await rebels.AddAsync(r); Assert.Equal("myRebels", newR.SplitDiscriminator); httpTest .ShouldHaveCalled("http://localhost/rebels") .WithVerb(HttpMethod.Post); }
public void ThenTheResultShouldBeTheDatabaseWasCreatedOnTheServer() { ICouchDatabase database = couchClient.GetDatabase(databaseName); Assert.That(databaseName, Is.EqualTo(database.Name)); }
public Database_Tests() { _client = new CouchClient("http://localhost"); _rebels = _client.GetDatabase <Rebel>(); }