Esempio n. 1
0
        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();
        }
Esempio n. 2
0
        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();
        }
Esempio n. 3
0
        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));
        }