private bool CanAnimalFitAfterPlaced(Animal animalToPlace, Animal animalToCheck) { Wagon wagon = new Wagon(); wagon.AddAnimal(animalToPlace); return(wagon.CanAnimalBeAdded(animalToCheck)); }
public void Test_CanAnimalBeAddedToEmptyWagon() { Wagon wagon = new Wagon(); bool result = wagon.CanAnimalBeAdded(new Animal(Diet.Carnivore, Size.Medium)); Assert.IsTrue(result); }
public void CanAnimalBeAddedCarnivoreSameWeightTest() { Wagon wagon = new Wagon(); Animal carnivore1 = new Animal(Diet.Carnivore, Size.Small); Animal carnivore2 = new Animal(Diet.Carnivore, Size.Small); wagon.AddAnimal(carnivore1); bool actual = wagon.CanAnimalBeAdded(carnivore2); Assert.AreEqual(false, actual); }
public void CanAnimalBeAddedHerbivoreSameWeightTest() { Wagon wagon = new Wagon(); Animal herbivore1 = new Animal(Diet.Herbivore, Size.Small); Animal herbivore2 = new Animal(Diet.Herbivore, Size.Small); wagon.AddAnimal(herbivore1); bool actual = wagon.CanAnimalBeAdded(herbivore2); Assert.AreEqual(true, actual); }
public void Test_WagonCannotOverload() { Wagon wagon = new Wagon() { animalsInWagon = new List <Animal>() { new Animal(Diet.Herbivore, Size.Large), new Animal(Diet.Herbivore, Size.Large) } }; bool result = wagon.CanAnimalBeAdded(new Animal(Diet.Carnivore, Size.Small)); Assert.IsFalse(result); }
public void Test_BiggerCarnivoreCannotBeAddedToSmallerAnimals() { Wagon wagon = new Wagon() { animalsInWagon = new List <Animal>() { new Animal(Diet.Herbivore, Size.Small) } }; bool result = wagon.CanAnimalBeAdded(new Animal(Diet.Carnivore, Size.Medium)); Assert.IsFalse(result); }
public void CanAnimalBeAddedWeightFailureTest() { Animal animal1 = new Animal(Diet.Herbivore, Size.Large); Animal animal2 = new Animal(Diet.Herbivore, Size.Large); Animal animal3 = new Animal(Diet.Herbivore, Size.Small); Wagon wagon = new Wagon(); wagon.AddAnimal(animal1); wagon.AddAnimal(animal2); bool actual = wagon.CanAnimalBeAdded(animal3); Assert.AreEqual(false, actual); }