public async void Should_Fail_When_Geocoding_Nonexistant_Address() { var expected = GoogleApiConstants.GOOGLE_GEOCODE_ERROR_INVALID_ADDRESS; var service = new GoogleGeocodeService(); var address = new Address() { Street1 = "9999 Bvasdgdgdsgfgdsgsdgdsawe", City = "Long Basdfasfasdfeach", State = "CA", Zip = 90840 }; var result = await service.GeocodeAsync(address); result.Error.Should().Be(expected); }
public async void Should_Fail_When_Geocoding_Csulb_Wrong_Address() { var service = new GoogleGeocodeService(); var address = new Address() { Street1 = "1250 Bellflower Blvd", City = "Long Beach", State = "CA", Zip = 90840 }; var expectedLat = 0; var expectedLong = 0; var result = await service.GeocodeAsync(address); result?.Data.Latitude.Should().NotBe(expectedLat); result?.Data.Longitude.Should().NotBe(expectedLong); }
public async void Should_Pass_When_Geocoding_Csulb() { var service = new GoogleGeocodeService(); var address = new Address() { Street1 = "1250 Bellflower Blvd", City = "Long Beach", State = "CA", Zip = 90840 }; var expectedLat = 33.7830608; var expectedLong = -118.1148909; var result = await service.GeocodeAsync(address); result?.Data.Latitude.Should().Equals(expectedLat); result?.Data.Longitude.Should().Equals(expectedLong); }