public void WhenGettingCountryListAndRepositoryReturnsNoRecords_ThenReturnsEmptyCollection() { var countryRepositoryMock = new Mock<ICountryRepository>(); countryRepositoryMock.Setup(c => c.GetAll()).Returns(new List<Country>()); var services = new GetCountries(countryRepositoryMock.Object); var countries = services.Execute(); Assert.Empty(countries); }
public void WhenGettingCountryList_ThenReturnsCountryNames() { var countryRepositoryMock = new Mock<ICountryRepository>(); countryRepositoryMock.Setup(c => c.GetAll()).Returns(new List<Country>() {new Country()}); var services = new GetCountries(countryRepositoryMock.Object); var countries = services.Execute(); Assert.NotNull(countries); Assert.Equal(1, countries.Count); }