Exemplo n.º 1
0
        public void Scenario_ComboOffer_WithOffer()
        {
            double expectedValue = 30;
            bool   canExecute    = _promotionStrategy.CanExecute(_productWithOffer.FirstOrDefault(), _promotions);

            if (canExecute)
            {
                double actualValue = _promotionStrategy.CalculateProductPrice(_productWithOffer);
                Assert.AreEqual(expectedValue, actualValue);
            }
        }
        public void Scenario_AdditionalItemOffer_WithOffer()
        {
            List <ProductCheckout> orderCart = new List <ProductCheckout>();

            orderCart.Add(_productWithOffer);
            double expectedValue = 130;
            bool   canExecute    = _promotionStrategy.CanExecute(_productWithOffer, _promotions);

            if (canExecute)
            {
                double actualValue = _promotionStrategy.CalculateProductPrice(orderCart);
                Assert.AreEqual(expectedValue, actualValue);
            }
        }