Examples of DiscountLine


Examples of uk.org.woodcraft.bookings.ApplyCoCampDiscountsAction.DiscountLine

   
    action.generateDiscounts();
   
    List<DiscountLine> discountlines = action.getDiscountLines();
   
    DiscountLine discount = discountlines.get(0);
    assertEquals(TestConstants.UNIT1_NAME, discount.getUnit().getName());
    assertEquals(10.0d, discount.getDiscount().getAmount(), 0);
    assertEquals(142.0d, discount.getTotalQualifyingPayments(), 0);
    assertEquals(1, discount.getPaidBookings().size());
    assertEquals(1, discount.getUnpaidBookings().size());
    assertEquals("Earlybird booking discount for 1 people", discount.getDiscount().getName());
    assertEquals("142.00 received prior to deadline; There were 1 additional bookings with insufficient funds received to qualify for the discount",
            discount.getDiscount().getComments());
   
    discount = discountlines.get(1);
    assertEquals(TestConstants.UNIT2_NAME, discount.getUnit().getName());
    assertEquals(0.0d, discount.getDiscount().getAmount(), 0);
    assertEquals(70.0d, discount.getTotalQualifyingPayments(), 0);
    assertEquals(0, discount.getPaidBookings().size());
    assertEquals(2, discount.getUnpaidBookings().size());
    assertEquals("Earlybird booking discount for 0 people", discount.getDiscount().getName());
    assertEquals("70.00 received prior to deadline; There were 2 additional bookings with insufficient funds received to qualify for the discount",
        discount.getDiscount().getComments());   
   
    List<Transaction> expectedSessionTransactions = new ArrayList<Transaction>(2);
    expectedSessionTransactions.add(discountlines.get(0).getDiscount());
   
    // Only one discount as 0 discount should be filtered.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.