Пример #1
0
        public async void RejectChangesTest()
        {
            using var factory    = new TestContextFactory();
            using var context    = factory.CreateContext();
            using var unitOfWork = new EFUnitOfWork(context);
            context.Database.EnsureCreated();

            await unitOfWork.Repository <RandomizerList>().Remove(1);

            await unitOfWork.CancelChangesAsync();

            await unitOfWork.SaveChangesAsync();

            (await unitOfWork.Repository <RandomizerList>().GetItems(0, 10)).Count().Should().Be(3);
        }