Example #1
0
 /** Checkout processes grocery store items from customer's basket for a given date. */
 public static void tc00001(ArrayList<Basket> list) {
   System.out.println("GP1-00001");
   Basket b;
   Receipt receipt = null;
   Tax tax = new Tax(7.7, new Date(), new Date());
   for (int i = 0; i < 3; i++) {
     // System.out.println(list.get(i));
     b = list.get(i);
     try {
       if (b.getPaymentType().equals("card")) {
         receipt =
             new Receipt(
                 b.getDate(),
                 b.getItemBasket(),
                 b.getCustomer(),
                 tax,
                 b.getCashback(),
                 b.getCouponList());
       } else if (b.getPaymentType().equals("cash")) {
         receipt =
             new Receipt(
                 b.getDate(), b.getItemBasket(), b.getAmountPaid(), tax, b.getCouponList());
       }
     } catch (NullPointerException e) {
       System.out.println("Empty");
     }
     System.out.println("[TESTING REQ GP1-00001]");
     System.out.println(receipt.makeHeader());
     System.out.println(receipt.printGroceries());
     System.out.println("[END TESTING REQ GP1-00001]");
   }
 }
Example #2
0
 /** GP1-000010 Checkout shall print a blank line after the fifth line on each receipt. */
 public static void tc00010(Receipt receipt) {
   System.out.println("GP1-00010");
   System.out.println("Blank line after the fifth line");
   System.out.println(receipt.makeHeader() + "\n");
 }
Example #3
0
 /**
  * GP1-00008 Checkout shall print centered on the fourth line from the top of each receipt
  * "Hoggley-Woggley-Inc.
  */
 public static void tc00008(Receipt receipt) {
   System.out.println("GP1-00008");
   System.out.println("4th line: Hoggley-Woggley-Inc. centered");
   System.out.println(receipt.makeHeader() + "\n");
 }
Example #4
0
 /**
  * GP1-00009 Checkout shall print centered on the fifth line from the top of each receipt the
  * store identifier.
  */
 public static void tc00009(Receipt receipt) {
   System.out.println("GP1-00009");
   System.out.println("5th line: store identifier");
   System.out.println(receipt.makeHeader() + "\n");
 }
Example #5
0
 /** GP1-00006 Checkout shall print out each receipt with a top margin of three blank lines. */
 public static void tc00006(Receipt receipt) {
   System.out.println("GP1-00006");
   System.out.println("Top margin of 3 blank lines");
   System.out.println(receipt.makeHeader() + "\n");
 }