Class ProductMultiBuyPromotionTest

    • Constructor Detail

      • ProductMultiBuyPromotionTest

        public ProductMultiBuyPromotionTest()
    • Method Detail

      • setUp

        public void setUp()
                   throws java.lang.Exception
        Overrides:
        setUp in class AbstractPromotionTest
        Throws:
        java.lang.Exception
      • testProductMultiBuyPromotion

        public void testProductMultiBuyPromotion()
                                          throws CalculationException
        HW1210-3411: 253.0 Euro, HW1100-0023: 523.99 Euro, and HW2310-1001: 29.90 Euro. The ProductMultiBuyPromotion will be fired if at least 3 pieces of HW1210-3411 and/or HW1100-0023 are in the cart for 900 Euro.
        • adds one piece of all those products in cart, and tests the total price,
        • adds one more HW1210-3411 and HW1100-0023 in cart, and tests the total price again,
        • updates with the ProductMultiBuyPromotion, and checks the total price,
        • in ProductMultiBuyPromotion, the product with lowest price will be first consumed,
        • so two HW1210-3411 and one HW1100-0023 are valid for the ProductMultiBuyPromotion under this situation,
        • checks the total price: 900 + 523.99 + 29.90 = 1453.89.
        Throws:
        CalculationException