Beispiel #1
0
        public void TestGetAllCars_WithoutTestData_ShouldGetAllCars()
        {
            // Arrange
            var contextFactory = new ApplicationDbContextFactory();
            var context        = contextFactory.CreateApplicationDbContext();

            var mapperFactory = new AutoMapperFactory();
            var mapper        = mapperFactory.CreateMapper();

            var carServices = new CarServices(context, mapper);

            // Act
            var actualCount   = carServices.GetAllCars().Count;
            var expectedCount = 0;

            // Assert
            Assert.Equal(expectedCount, actualCount);
        }
 public IActionResult Get()
 {
     return(Ok(_carServices.GetAllCars()));
 }