Esempio n. 1
0
        public void TrainCarriage_Should_Be_Able_To_Hold_2_Big_Herbivores()
        {
            TrainCarriage trainCarriage = new TrainCarriage(new Animal(Size.Big, EatingBehaviour.Herbivore));

            Assert.IsTrue(trainCarriage.TryAddAnimal(new Animal(Size.Big, EatingBehaviour.Herbivore)));
            Assert.IsTrue(trainCarriage.Animals.Count.Equals(2));
            Assert.IsTrue(trainCarriage.Animals.Where(anml => anml.Size.Equals(Size.Big) && anml.EatingBehaviour.Equals(EatingBehaviour.Herbivore)).ToList().Count.Equals(2));
        }
Esempio n. 2
0
        public void TryAddAnimal_Should_Not_Be_Able_To_Add_Anything_To_A_Full_TrainCarriage()
        {
            TrainCarriage trainCarriage = new TrainCarriage(new Animal(Size.Big, EatingBehaviour.Herbivore));

            trainCarriage.TryAddAnimal(new Animal(Size.Big, EatingBehaviour.Herbivore));
            Assert.IsFalse(trainCarriage.TryAddAnimal(new Animal(Size.Big, EatingBehaviour.Herbivore)));
            Assert.IsFalse(trainCarriage.TryAddAnimal(new Animal(Size.Medium, EatingBehaviour.Herbivore)));
            Assert.IsFalse(trainCarriage.TryAddAnimal(new Animal(Size.Small, EatingBehaviour.Herbivore)));
            Assert.IsFalse(trainCarriage.TryAddAnimal(new Animal(Size.Big, EatingBehaviour.Carnivore)));
            Assert.IsFalse(trainCarriage.TryAddAnimal(new Animal(Size.Medium, EatingBehaviour.Carnivore)));
            Assert.IsFalse(trainCarriage.TryAddAnimal(new Animal(Size.Small, EatingBehaviour.Carnivore)));
        }