public void ValidateValues_success() { Animal animal = new Herbivour() { name = "Hippo", food = FoodType.Plants, size = BodySize.Big }; bool valid = animal.ValidateValues(); Assert.IsTrue(valid); }
public void ResetToDefault() { Animal animal = new Herbivour() { name = "Hippo", food = FoodType.Plants, size = BodySize.Big }; animal.ResetToDefault(); Assert.AreEqual("", animal.name); Assert.AreEqual(FoodType.Meat, animal.food); Assert.AreEqual(BodySize.Small, animal.size); }
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); }
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); }