예제 #1
0
        public void BreadDeal_ReturnTotalAfterDealApplied_Float()
        {
            Bread loaves = new Bread(3);

            loaves.BreadDeal();
            Assert.AreEqual(10, loaves.TotalPrice);
        }
예제 #2
0
    // public static void ValidateUserInput(string bread, string pastries)
    // {
    //   int numBread = 0;
    //   int numPastries = 0;
    //   while (String.IsNullOrEmpty(bread) || String.IsNullOrEmpty(pastries) || !(int.TryParse(bread, out int number) && int.TryParse(pastries, out number)))
    //   {
    //     Console.WriteLine("If you changed your mind about buying something enter 0, otherwise please enter a positive integer:");
    //     bread = Console.ReadLine();
    //     pastries = Console.ReadLine();
    //     if (int.TryParse(bread, out number) && int.TryParse(pastries, out number))
    //     {
    //       numBread = int.Parse(bread);
    //       numPastries = int.Parse(pastries);
    //     }
    //     if (numBread < 0 || numPastries < 0)
    //     {
    //       bread = "";
    //     }
    //   }
    //   CreateOrder(numBread, numPastries);
    // }

    public static void CreateOrder(int numBread, int numPastries)
    {
        Bread  breadOrder  = new Bread(numBread);
        Pastry pastryOrder = new Pastry(numPastries);

        breadOrder.BreadDeal();
        pastryOrder.PastryDeal();
        DisplayTotal(breadOrder, pastryOrder);
    }