Ejemplo n.º 1
0
        public void Checkout_Basket_Calculate_Individual_Promotion_D_Items_Only_No_Promotion()
        {
            // Arrange
            ICalculatePromotionD calculatePromotionD2Items = new CalculatePromotionD(GenerateSpecifiedItemsBasket(1, "D", 55).Items);

            // Assert
            Assert.Equal(55, calculatePromotionD2Items.CalculatePromotionDCost());
        }
Ejemplo n.º 2
0
        public void Checkout_Basket_Calculate_Individual_Promotion_D_Mixed_Amount()
        {
            // Arrange
            ICalculatePromotionD calculatePromotionD3Items = new CalculatePromotionD(GenerateSpecifiedItemsBasket(3, "D", 55).Items);
            ICalculatePromotionD calculatePromotionD5Items = new CalculatePromotionD(GenerateSpecifiedItemsBasket(5, "D", 55).Items);
            ICalculatePromotionD calculatePromotionD7Items = new CalculatePromotionD(GenerateSpecifiedItemsBasket(7, "D", 55).Items);
            ICalculatePromotionD calculatePromotionD8Items = new CalculatePromotionD(GenerateSpecifiedItemsBasket(8, "D", 55).Items);

            // Assert
            Assert.Equal(Math.Round(137.50M, 2), calculatePromotionD3Items.CalculatePromotionDCost());
            Assert.Equal(Math.Round(199.38M, 2), calculatePromotionD5Items.CalculatePromotionDCost());
            Assert.Equal(Math.Round(245.78M, 2), calculatePromotionD7Items.CalculatePromotionDCost());
            Assert.Equal(Math.Round(225.59M, 2), calculatePromotionD8Items.CalculatePromotionDCost());
        }
Ejemplo n.º 3
0
        public void Checkout_Basket_Calculate_Individual_Promotion_D_Items_Only_Multiple_2_Item_Count()
        {
            // Arrange - Multples of 2 starting with 2.

            ICalculatePromotionD calculatePromotionD2Items = new CalculatePromotionD(GenerateSpecifiedItemsBasket(2, "D", 55).Items);
            ICalculatePromotionD calculatePromotionD4Items = new CalculatePromotionD(GenerateSpecifiedItemsBasket(4, "D", 55).Items);
            ICalculatePromotionD calculatePromotionD6Items = new CalculatePromotionD(GenerateSpecifiedItemsBasket(6, "D", 55).Items);
            ICalculatePromotionD calculatePromotionD8Items = new CalculatePromotionD(GenerateSpecifiedItemsBasket(8, "D", 55).Items);

            // Assert
            Assert.Equal(Math.Round(82.50M, 2), calculatePromotionD2Items.CalculatePromotionDCost());
            Assert.Equal(Math.Round(144.38M, 2), calculatePromotionD4Items.CalculatePromotionDCost());
            Assert.Equal(Math.Round(190.78M, 2), calculatePromotionD6Items.CalculatePromotionDCost());
            Assert.Equal(Math.Round(225.59M, 2), calculatePromotionD8Items.CalculatePromotionDCost());
        }