public PricingPlan Calculate(IEnumerable <ElementInfo> elements) { _logger.Log("Elements:" + elements); var pricingPlan = _priceCalculator.Calculate(elements); _logger.Log("Pricing plan:" + pricingPlan); return(pricingPlan); }
public IInvoicePrinter Calculate() { IPriceCalculator calculator = _calculatorFactory.Create(_customerType); _invoice.Price = calculator.Calculate(_invoice.WashProgram, _currency); _discount = calculator.Discount; return(this); }
public void GIVEN_the_basket_has_1_bread_1_butter_1_milk_WHEN_I_total_the_basket_THEN_the_total_should_be_2_95() { //Arrange var request = SetUpBasket(); request.Bread.Amount = 1; request.Butter.Amount = 1; request.Milk.Amount = 1; //Act var result = priceCalculator.Calculate(request); //Assert Assert.AreEqual(2.95, result); }
public decimal Total() { totalPrice = calc.Calculate(cart); return(totalPrice); }
public PricingPlan Calculate(IEnumerable <ElementInfo> elements) { var newElements = elements.Where(x => !_oldItems.Contains(x.ItemId)).ToList(); return(_priceCalculator.Calculate(newElements)); }
public void Create(Order order) { _priceCalculator.Calculate(order); _orderRepo.Create(order); }
private void DoTest(decimal targetPrice, params string[] items) { var price = _priceCalculator.Calculate(items); Assert.AreEqual(targetPrice, price); }