Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public decimal Total()
 {
     totalPrice = calc.Calculate(cart);
     return(totalPrice);
 }
Ejemplo n.º 5
0
        public PricingPlan Calculate(IEnumerable <ElementInfo> elements)
        {
            var newElements = elements.Where(x => !_oldItems.Contains(x.ItemId)).ToList();

            return(_priceCalculator.Calculate(newElements));
        }
Ejemplo n.º 6
0
 public void Create(Order order)
 {
     _priceCalculator.Calculate(order);
     _orderRepo.Create(order);
 }
Ejemplo n.º 7
0
        private void DoTest(decimal targetPrice, params string[] items)
        {
            var price = _priceCalculator.Calculate(items);

            Assert.AreEqual(targetPrice, price);
        }