Beispiel #1
0
        public void CheckIfAllowedTest_Failure_empty()
        {
            Animal animal = new Carnivour()
            {
                name = "Wolf",
                food = FoodType.Meat,
                size = BodySize.Medium
            };

            Animal newAnimal = new Carnivour();

            bool allowed = animal.CheckIfAllowed(newAnimal);
        }
Beispiel #2
0
        public void CheckIfAllowedTest_Happy_Meateater_LargerSize()
        {
            Animal animal = new Carnivour()
            {
                name = "Wolf",
                food = FoodType.Meat,
                size = BodySize.Medium
            };

            Animal newAnimal = new Carnivour()
            {
                name = "Lion",
                food = FoodType.Meat,
                size = BodySize.Big
            };

            bool allowed = animal.CheckIfAllowed(newAnimal);

            Assert.IsFalse(allowed);
        }
Beispiel #3
0
        public void CheckIfAllowedTest_Happy_Planteater_SmallerSize()
        {
            Animal animal = new Carnivour()
            {
                name = "Wolf",
                food = FoodType.Meat,
                size = BodySize.Medium
            };

            Animal newAnimal = new Herbivour()
            {
                name = "mice",
                food = FoodType.Plants,
                size = BodySize.Small
            };

            bool allowed = animal.CheckIfAllowed(newAnimal);

            Assert.IsFalse(allowed);
        }
Beispiel #4
0
        public void CheckIfAllowedTest_Happy_Planteater_LargerSize()
        {
            IAnimal animal = new Carnivour()
            {
                name = "Wolf",
                food = FoodType.Meat,
                size = BodySize.Medium
            };

            IAnimal newAnimal = new Herbivour()
            {
                name = "Elephant",
                food = FoodType.Plants,
                size = BodySize.Big
            };

            bool allowed = animal.CheckIfAllowed(newAnimal);

            Assert.IsTrue(allowed);
        }