Пример #1
0
        public void HerbivoreEatsPlant()
        {
            toDelete.Clear();
            Position herbivorePosition = new Position(1, 1);
            Position plantPosition     = new Position(2, 1);

            herbivore           = new Herbivore(herbivorePosition, BeginTerrarium);
            testPlant           = new Plant();
            testPlant.Position  = plantPosition;
            testPlant.Terrarium = BeginTerrarium;
            var health = herbivore.Health;

            herbivore.Eat(testPlant, toDelete);
            // health moet met één verhogen als plant wordt gegeten
            Assert.AreEqual(health + 1, herbivore.Health);
            Assert.IsTrue(toDelete.Contains(testPlant));
        }
Пример #2
0
 public void AnimalFood()
 {
     herbivore.Eat();
     predator.Eat(herbivore);
 }
Пример #3
0
 public void RunFoodChain()
 {
     carnivore.Eat(herbivore);
     herbivore.Eat("grass");
 }