public void Cook(Potato potato, Carrot carrot)
        {
            if (potato == null)
            {
                throw new ArgumentException("ArugumentOutOfPotatoExeption");
            }

            if (carrot == null)
            {
                throw new ArgumentException("ArugumentOutOfCarrotExeption");
            }

            var bowl = this.GetBowl();

            bowl.Add(carrot);
            bowl.Add(potato);

            Console.WriteLine("Your meal contains: ");
            foreach (var vegetable in bowl.Vegetables)
            {
                Console.WriteLine(vegetable);
            }

            Console.ReadKey();
        }
 static void Main()
 {
     Chef test = new Chef("Some Guy");
     Carrot carrot = new Carrot();
     Potato potato = new Potato();
     test.PrepareVegetable(carrot);
     test.PrepareVegetable(potato);
     test.Cook(potato, carrot);
 }
        internal static void Main()
        {
            Potato goodPotato = new Potato();
            Potato badPotato = new Potato();
            Carrot carrot = new Carrot();
            Chef gRamsay = new Chef("G - Ramsay");

            gRamsay.PrepareVegetable(goodPotato);
            gRamsay.PrepareVegetable(carrot);

            Console.WriteLine("Test 1: (press any key for test 2)");
            CookMeal(gRamsay, goodPotato, carrot);

            Console.WriteLine("Test 2:");
            CookMeal(gRamsay, badPotato, carrot);
        }
Beispiel #4
0
        public void Cook()
        {
            Potato potato = this.GetPotato();

            this.Peel(potato);
            this.Cut(potato);

            Carrot carrot = this.GetCarrot();

            this.Peel(carrot);
            this.Cut(carrot);

            Bowl bowl = this.GetBowl();

            bowl.Add(potato);
            bowl.Add(carrot);
        }
 internal static void CookMeal(Chef chef, Potato potato, Carrot carrot)
 {
     if (potato != null && chef != null)
     {
         if (potato.IsPeeled && !potato.IsRotten)
         {
             chef.Cook(potato, carrot);
         }
         else
         {
             Console.WriteLine(chef.Name + " ANGRY!!! " + chef.Name + " SMASHHH!!!");
             Console.WriteLine("Don't you be givin me no rotten potatoes!");
             Console.ReadLine();
         }
     }
     else
     {
         Console.WriteLine("Where my potato AT!");
     }
 }
 private Carrot GetCarrot()
 {
     Carrot newCarrot = new Carrot();
         return newCarrot;
 }
        private Carrot GetCarrot()
        {
            Carrot newCarrot = new Carrot();

            return(newCarrot);
        }