Пример #1
0
        public async Task Manufacturer_Repository_Should_Remove_Manufacturer_Async()
        {
            // Arrange
            var context        = TestSetUpHelper.CreateDbContext();
            var repository     = new ManufacturerRepository(context);
            var expectedEntity = new Manufacturer()
            {
                Id   = 4,
                Name = "TestName",
            };

            await repository.AddAsync(expectedEntity);

            await context.SaveChangesAsync();

            // Act
            await repository.RemoveAsync(expectedEntity.Id);

            await context.SaveChangesAsync();

            var actualEntity = await repository.GetByIdAsync(expectedEntity.Id);

            // Assert
            Assert.Null(actualEntity);
        }