public static void CartReport()
 {
     Console.WriteLine("---------------------------------------------");
     if (Bread.BreadCount() == 0 && Pastry.PastryCount() == 0)
     {
         EmptyCart();
     }
     else
     {
         Console.WriteLine("Your shopping cart contains...");
         Bread.DisplayBreadList();
         Pastry.DisplayPastryList();
         Console.WriteLine("Your total comes to...");
         Console.WriteLine("$" + (Bread.BreadPrice() + Pastry.PastryPrice()));
     }
 }
 public static void Purchase()
 {
     Console.WriteLine("---------------------------------------------");
     if (Bread.BreadCount() == 0 && Pastry.PastryCount() == 0)
     {
         EmptyCart();
         Order();
     }
     else
     {
         if (((Bread.BreadCount() + 1) % 3) == 0)
         {
             Console.WriteLine("The buy 2, get 1 Free sale qualifies you for a free loaf of bread!  Feel free to go back and add your free loaf of bread to your order. The free loaf must be in your cart at the time of purchase.");
         }
         Console.WriteLine("Are you sure you want to make this purchase?  Type 'y' for yes or 'n' for no.");
         string confirmPurch = Console.ReadLine();
         if (confirmPurch == "y")
         {
             Console.WriteLine("---------------------------------------------");
             Console.WriteLine("---------------------------------------------");
             Console.WriteLine("Your pretend bread order has been purchase with pretend money!");
             Console.WriteLine("We hope that you enjoy filling your pretend stomach!");
             Console.WriteLine("---------------------------------------------");
             Main();
         }
         else if (confirmPurch == "n")
         {
             Order();
         }
         else
         {
             Invalid();
             Purchase();
         }
     }
 }
Exemple #3
0
 public void BreadCount_CountNumberOfTotalLoaves_True()
 {
     Bread.BreadDefault();
     Bread.GetBread()[0].Quantity = 6;
     Assert.AreEqual(6, Bread.BreadCount());
 }