public void GetAnimal_ReturnsAnimal() { var testAnimalService = new TestAnimalService { Animals = new List <Animal> { new Animal { ID = 123, Name = "TestAnimal", Description = "Not a real animal." } } }; var animalController = new AnimalController(testAnimalService); var response = animalController.GetAnimal(123); Assert.Equal(new Animal { ID = 123, Name = "TestAnimal", Description = "Not a real animal." }, response.Value); }
public void GetAnimals_ReturnsAllAnimals() { var testAnimalService = new TestAnimalService { Animals = new List <Animal> { new Animal { Name = "TestAnimal", Description = "Not a real animal." } } }; var animalController = new AnimalController(testAnimalService); var response = animalController.Get(); Assert.Equal( new List <Animal> { new Animal { Name = "TestAnimal", Description = "Not a real animal." } }, response ); }