示例#1
0
        public void ValidateValues_Failure()
        {
            Animal animal = new Carnivour();

            bool valid = animal.ValidateValues();

            Assert.IsFalse(valid);
        }
示例#2
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);
        }
示例#3
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);
        }
示例#4
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);
        }
示例#5
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);
        }