public void GetByCityState_ValidCityEmptyState_ThrowsArgumentException() { var locationService = new LocationService(new FakeLocationRepository()); var argEx = Assert.Throws<ArgumentException>(() => locationService.GetByCityState("San Luis Obispo", string.Empty)); Assert.True(argEx.Message.StartsWith("State must be non-null")); }
public void GetByCityState_NullCityValidState_ThrowsArgumentException() { var locationService = new LocationService(new FakeLocationRepository()); var argEx = Assert.Throws<ArgumentException>(() => locationService.GetByCityState(null, "ZZ")); Assert.True(argEx.Message.StartsWith("City must be non-null")); }
public void GetByCityState_ValidCityInvalidState_ReturnsEmptyList() { // Arrange var locationService = new LocationService(new FakeLocationRepository()); // Act IEnumerable<Location> nonsenseLocations = locationService.GetByCityState("Sacramento", "BB"); // Assert Assert.True(nonsenseLocations.Count() == 0); }
public void GetByCityState_ValidCityValidState_ReturnsNonEmptyList() { // Arrange var locationService = new LocationService(new FakeLocationRepository()); // Act IEnumerable<Location> sactoLocations = locationService.GetByCityState("Sacramento", "CA"); // Assert Assert.True(sactoLocations.Count() > 0); }