public void CalculateSeatedSize() { //Arrange List <Animal> animals = new List <Animal>() { new Animal(Diet.Meat, AnimalSize.smallsize), new Animal(Diet.Plants, AnimalSize.mediumsize), new Animal(Diet.Plants, AnimalSize.largesize) }; int expectedResult = 0; Wagon wagon = new Wagon(); //Act foreach (Animal animal in animals) { expectedResult += (int)animal.AnimalSize; // In methode calculating the combined size of the placed animals. wagon.TryAddAnimal(animal); } //Assert Assert.AreEqual(expectedResult, wagon.CalculateSeatedSize()); }
public void CalculateSeatedSize() { //Arrange List <Animal> animals = new List <Animal>() { new Animal(Diet.Carnivore, Size.Small), new Animal(Diet.Herbivore, Size.Medium), new Animal(Diet.Herbivore, Size.Large) }; int expectedResult = 0; Wagon wagon = new Wagon(); //Act foreach (Animal animal in animals) { expectedResult += (int)animal.Size; // In methode calculating the combined size of the placed animals. wagon.PlaceAnimal(animal); } //Assert Assert.AreEqual(expectedResult, wagon.CalculateSeatedSize()); }