public async Task PersistDataTestFail() { var model = TenantData.GetSecond(); model.Id = string.Empty; var persist = new Persist <Tenant> { Model = model }; await persist.Execute(); persist.Confirm.Success.Should().BeFalse(); }
public async Task PersistDataTestInsert() { using var store = GetDocumentStore(); using var session = store.OpenAsyncSession(); var model = TenantData.GetSecond(); model.Id = string.Empty; var persist = new Persist <Tenant> { Session = session, Model = model }; await persist.Execute(); persist.Confirm.Success.Should().BeTrue(); }
public async Task TenantSaveDataTest() { using var store = GetDocumentStore(); using var session = store.OpenAsyncSession(); var model = TenantData.GetSecond(); var persist = new TenantSave { Session = session, Model = model }; await persist.Execute(); persist.Confirm.Should().NotBeNull(); persist.Confirm.Identity.Should().Be(model.Id); persist.Confirm.Success.Should().BeTrue(); Assert.That(persist.Model, Is.DeepEqualTo(model)); }