Class ProductBundlePromotionTest

    • Constructor Detail

      • ProductBundlePromotionTest

        public ProductBundlePromotionTest()
    • Method Detail

      • setUp

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

        public void testProductBundlePromotion()
                                        throws CalculationException
        HW1210-3411: 253 Euro, HW1100-0023: 523.99 Euro, HW2310-1001: 29.90 Euro, and HW2320-1009: 99.80 Euro. Adds all these products to cart, and check the price of the cart before and after the updatePromoitions(). The bundle promotion defines the combination of three products: [HW1210-3411, HW1100-0023, and HW2310-1001], and the price is 700 Euro.
        • tests the total price, 2 * 253 + 2 * 523.99 + 3 * 29.90 + 2 * 99.80 = 1843.28,
        • update promotion, and since only HW2310-1001 has the quantity of 3, the last one will not be considered in the promotion,
        • tests the total price, should be: 2 * 700 + 1 * 29.90 + 2 * 99.80 = 1629.5.
        Throws:
        CalculationException