示例#1
0
        static void Main(string[] args)
        {
            var omnivore = new CarnivoreOmnivore();
            var meat     = new Food(Origin.Animal);
            var plant    = new Food(Origin.Vegetal);

            Console.WriteLine("Carnivore Twin eating Meat and Delegating plant food for Herbivore Twin.");
            Console.WriteLine(omnivore.EatFood(meat.Type));
            Console.WriteLine(omnivore.EatFood(plant.Type));

            Console.ReadKey();
        }
示例#2
0
        public void CarnivoreTwinEatingPlant()
        {
            var omnivore = new CarnivoreOmnivore();
            var plant = new Food(Origin.Vegetal);

            string eatingMessage = omnivore.EatFood(plant.Type);
            string eatingVegetalMessage = "Eating plant origin food.";

            Assert.AreEqual(eatingVegetalMessage, eatingMessage, true);
        }
示例#3
0
        public void CarnivoreTwinEatingMeat()
        {
            var omnivore = new CarnivoreOmnivore();
            var meat = new Food(Origin.Animal);

            string eatingMessage = omnivore.EatFood(meat.Type);
            string eatingAnimalMessage = "Eating animal origin food.";

            Assert.AreEqual(eatingAnimalMessage,eatingMessage,true);
        }