Beispiel #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 !!!");
        }
Beispiel #3
0
        public void Add(Vegetable someVegatable)
        {
            if (someVegatable == null)
            {
                throw new ArgumentNullException("You must pass an Vegetable object");
            }

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

            someVegatable.IsPeeled = true;
        }