public void GetByZipCode_ValidZipCode_ReturnsNonNullLocation() { // Arrange var locationService = new LocationService(new FakeLocationRepository()); // Act Location sacto = locationService.GetByZipCode("95814"); // Assert Assert.NotNull(sacto); }
public void GetByZipCode_WhiteSpaceZipCode_ThrowsArgumentException() { var locationService = new LocationService(new FakeLocationRepository()); var argEx = Assert.Throws<ArgumentException>(() => locationService.GetByZipCode("\t ")); Assert.True(argEx.Message.StartsWith("ZIP Code must be")); }
public void GetByZipCode_InvalidZipCode_ReturnsNullLocation() { // Arrange var locationService = new LocationService(new FakeLocationRepository()); // Act Location fantasyLand = locationService.GetByZipCode("xzy123"); // Assert Assert.Null(fantasyLand); }