Exemple #1
0
        public void CheckIfChangeCarDetailsActuallyChangesTheDetails()
        {
            var dbContext = new AutomobileDbContext();
            var service   = new CarsService(dbContext);

            var carFromDb = dbContext.CarOffers.FirstOrDefault();
            VisualizeCarDetailsViewModel model = new VisualizeCarDetailsViewModel()
            {
                Id          = carFromDb.Id,
                Type        = "New",
                Make        = "Audi",
                Model       = "Q7",
                Kilometers  = 150,
                FuelType    = "Diesel",
                HorsePower  = 150,
                EngineSize  = 1500,
                Gearbox     = "Automatic",
                Price       = 5000,
                Doors       = "2",
                Color       = "black",
                Year        = 2000,
                Description = "testt"
            };

            service.ChangeCarDetails(model);
            var priceAfterChangeCarDetails = carFromDb.Price;

            Assert.Equal(priceAfterChangeCarDetails, model.Price);
        }