public ActionResult Index() { var newConfiguration = _viewModelService.CreateConfigurationViewModel(_dbContext); newConfiguration.Price = _priceCalculationService.CalculatePrice(GetCurrency(), enginePower: newConfiguration.EnginePower); Session[Constants.ConfigurationSessionKey] = newConfiguration; return(View(newConfiguration)); }
public void Test_that_price_is_calculated_correctly() { // Arrange var priceExpected = 153.6M; var equipments = new List <Equipment> { new Equipment { PriceEuro = 10 }, new Equipment { PriceEuro = 15 } }; var rims = new Rims { PriceEuro = 12 }; var varnish = new Varnish { PriceEuro = 16.6M }; // Act var priceActual = _service.CalculatePrice(Currency.Euro, equipments, rims, varnish, 20); // Assert Assert.AreEqual(priceExpected, priceActual); }