Example #1
0
        public async void SaveAsync_ChangesQuantity_OnAdd()
        {
            //Arrange
            var contextOptions = InMemoryUtils.ProduceFreshDbContextOptions();

            //Act
            using (var context = new ApplicationDbContext(contextOptions))
            {
                context.Resources.Add(ResourceUtils.TestSet.First());

                IBasicRepositoryAsync <Resource, int> repo = new ResourcesRepository(context);
                await repo.SaveAsync();
            }

            //Assert
            using (var context = new ApplicationDbContext(contextOptions))
            {
                Assert.NotEmpty(context.Resources);
            }
        }