예제 #1
0
        public void AddAnimalToWagon_Add2LargeHerbivores_True()
        {
            Wagon  wagon   = new Wagon();
            Animal animal1 = new Animal(0, "", Diet.Herbivore, Size.Large);
            Animal animal2 = new Animal(0, "", Diet.Herbivore, Size.Large);


            wagon.AddAnimalToWagon(animal1);
            wagon.AddAnimalToWagon(animal2);

            Assert.AreEqual(wagon.GetAnimals().Count(), 2);
        }
        private bool IsThereSmallerHerbivore(Wagon wagon)
        {
            AnimalSize meateaterSize = wagon.GetMeatEaterSize();

            return(wagon.GetAnimals().Any(a => a.Size < meateaterSize && a.Eater == AnimalEater.Herbivore));
        }
 private bool WagonContainsMeateater(Wagon wagon)
 {
     return(wagon.GetAnimals().Any(a => a.Eater == AnimalEater.MeatEater));
 }