Exemplo n.º 1
0
        public void Cook(Vegetable vegetable)
        {
            Potato potato = new Potato();
            potato.Peel();
            potato.Cut();

            Carrot carrot = new Carrot();
            carrot.Peel();
            carrot.Cut();

            Bowl bowl = new Bowl();
            bowl.Add(potato);
            bowl.Add(carrot);
        }
Exemplo n.º 2
0
        public void CookTest()
        {
            // Base code refactored functionally goes below
            Potato potato = new Potato();
            Carrot carrot = new Carrot();
            Bowl bowl = new Bowl();

            potato.Peel();
            carrot.Peel();
            potato.Cut();
            carrot.Cut();

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

            // task2 - Potato COOKING! - included in the base code
            this.Cook(bowl.Ingredients);
        }
Exemplo n.º 3
0
        public void CookTest()
        {
            // Base code refactored functionally goes below
            Potato potato = new Potato();
            Carrot carrot = new Carrot();
            Bowl   bowl   = new Bowl();

            potato.Peel();
            carrot.Peel();
            potato.Cut();
            carrot.Cut();

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

            // task2 - Potato COOKING! - included in the base code
            this.Cook(bowl.Ingredients);
        }
Exemplo n.º 4
0
        public void Cook()
        {
            Potato potato = this.GetPotato();
            Carrot carrot = this.GetCarrot();

            List <Vegetable> veggies = new List <Vegetable>()
            {
                potato,
                carrot
            };

            Bowl bowl;

            bowl = this.GetBowl(veggies);

            potato.Peel();
            carrot.Peel();

            potato.Cut();
            carrot.Cut();

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