public static void BreadNumber(string breadType)
        {
            Console.WriteLine("---------------------------------------------");
            Console.WriteLine("How many loaves of this bread would you like in total?");
            Limit10();
            Back();
            string breadCount = Console.ReadLine();

            if (breadCount.All(Char.IsDigit) == true && int.Parse(breadCount) >= 0 && int.Parse(breadCount) <= 10)
            {
                Bread.GetBread()[Bread.BreadIndex(breadType)].Quantity = int.Parse(breadCount);
                Console.WriteLine("Your shopping cart has been updated.");
                Order();
            }
            else if (breadCount == "back")
            {
                BreadList();
            }
            else
            {
                Invalid();
                BreadNumber(breadType);
            }
        }
Exemple #2
0
 public void BreadIndex_FindIndexByName_True()
 {
     Bread.BreadDefault();
     Assert.AreEqual(0, Bread.BreadIndex("rye"));
 }