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 PersistDataTestUpdate()
        {
            using var store   = GetDocumentStore();
            using var session = store.OpenAsyncSession();
            var loader = new Loader <Tenant> {
                Session = session, Id = TenantData.FirstId
            };
            await loader.Execute();

            loader.Result.Should().NotBeNull();

            var persist = new Persist <Tenant> {
                Session = session, Model = loader.Result
            };
            await persist.Execute();

            persist.Confirm.Success.Should().BeTrue();
        }