Exemple #1
0
        public void Checkout_Basket_Calculate_Individual_Promotion_B_Items_No_Promotion_Item_Count()
        {
            // Arrange
            ICalculatePromotionB calculatePromotionB2Items = new CalculatePromotionB(GenerateSpecifiedItemsBasket(2, "B", 15).Items);


            // Assert
            Assert.Equal(30, calculatePromotionB2Items.CalculatePromotionBCost());
        }
Exemple #2
0
        public void Checkout_Basket_Calculate_Individual_Promotion_B_Mixed_Amount()
        {
            // Arrange
            ICalculatePromotionB calculatePromotionB5Items  = new CalculatePromotionB(GenerateSpecifiedItemsBasket(5, "B", 15).Items);
            ICalculatePromotionB calculatePromotionB8Items  = new CalculatePromotionB(GenerateSpecifiedItemsBasket(8, "B", 15).Items);
            ICalculatePromotionB calculatePromotionB11Items = new CalculatePromotionB(GenerateSpecifiedItemsBasket(11, "B", 15).Items);


            // Assert
            Assert.Equal(70, calculatePromotionB5Items.CalculatePromotionBCost());
            Assert.Equal(110, calculatePromotionB8Items.CalculatePromotionBCost());
            Assert.Equal(150, calculatePromotionB11Items.CalculatePromotionBCost());
        }
Exemple #3
0
        public void Checkout_Basket_Calculate_Individual_Promotion_B_Items_Only_Multiple_3_Item_Count()
        {
            // Arrange - Multples of 3 starting with 3.
            ICalculatePromotionB calculatePromotionB3Items  = new CalculatePromotionB(GenerateSpecifiedItemsBasket(3, "B", 15).Items);
            ICalculatePromotionB calculatePromotionB6Items  = new CalculatePromotionB(GenerateSpecifiedItemsBasket(6, "B", 15).Items);
            ICalculatePromotionB calculatePromotionB9Items  = new CalculatePromotionB(GenerateSpecifiedItemsBasket(9, "B", 15).Items);
            ICalculatePromotionB calculatePromotionB12Items = new CalculatePromotionB(GenerateSpecifiedItemsBasket(12, "B", 15).Items);


            // Assert
            Assert.Equal(40, calculatePromotionB3Items.CalculatePromotionBCost());
            Assert.Equal(80, calculatePromotionB6Items.CalculatePromotionBCost());
            Assert.Equal(120, calculatePromotionB9Items.CalculatePromotionBCost());
            Assert.Equal(160, calculatePromotionB12Items.CalculatePromotionBCost());
        }