Ejemplo n.º 1
0
        private void Cut(Vegetable someVegetable)
        {
            if (someVegetable == null)
            {
                throw new ArgumentNullException("You must pass an Vegetable object");
            }

            someVegetable.isCutted = true;
        }
        private static void Cook(Vegetable someVegatable)
        {
            if (someVegatable == null)
            {
                throw new ArgumentNullException("You can not pass an empty object");
            }

            Console.WriteLine(someVegatable.GetType().Name + " is cooking !!!");
        }
Ejemplo n.º 3
0
        public void Add(Vegetable someVegatable)
        {
            if (someVegatable == null)
            {
                throw new ArgumentNullException("You must pass an Vegetable object");
            }

            this.container.Add(someVegatable);
        }
Ejemplo n.º 4
0
        public static void Peel(Vegetable someVegatable)
        {
            if (someVegatable == null)
            {
                throw new ArgumentNullException("You must pass an Vegetable object");
            }

            someVegatable.IsPeeled = true;
        }