public void GivenHorseNotFoundThenNullHorse() { // Arrange var service = new HorseService(_fakeRepository); // Act var actualHorse = service.Get(-1); // Assert Assert.Null(actualHorse); }
public void ItReturnsHorseFromRepository(int id, string name) { // Arrange var expectedHorse = HorseFactory.Create(_fakeRepository, id, name).WithColor(); var service = new HorseService(_fakeRepository); // Act var actualHorse = service.Get(expectedHorse.Id); // Assert Assert.True(_fakeRepository.GetCalled); Assert.Equal(expectedHorse.Id, actualHorse.Id); Assert.Equal(expectedHorse.Name, actualHorse.Name); }