Пример #1
0
        public async Task Manufacturer_Repository_Should_Get_All_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
            var entities = await repository.GetAllAsync();

            // Assert
            Assert.Single(entities.ToList());
        }