diff --git a/.gitignore b/.gitignore index 35221a2..dd4f792 100644 --- a/.gitignore +++ b/.gitignore @@ -14,80 +14,13 @@ project.lock.json ## Visual Studio ################# -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. - -# User-specific files +.vs *.suo *.user -*.sln.docstates - -# Build results -[Dd]ebug/ -[Rr]elease/ -*_i.c -*_p.c -*.ilk -*.meta -*.obj -*.pch -*.pdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.vspscc -.builds -*.dotCover - -## TODO: If you have NuGet Package Restore enabled, uncomment this -#packages/ - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opensdf -*.sdf - -# Visual Studio profiler -*.psess -*.vsp - -# ReSharper is a .NET coding add-in -_ReSharper* - -# Installshield output folder -[Ee]xpress - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish - -# Others [Bb]in [Oo]bj -sql TestResults -*.Cache -ClientBin -stylecop.* -~$* -*.dbmdl -Generated_Code #added for RIA/Silverlight projects +_ReSharper* # Backup & report files from converting an old project file to a newer # Visual Studio version. Backup files are not needed, because we have git ;-) @@ -95,8 +28,6 @@ _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML - - ############ ## Windows ############ @@ -106,5 +37,3 @@ Thumbs.db # Folder config file Desktop.ini -.directory -*.userprefs diff --git a/Google/GoogleComponentFilter.cs b/Google/GoogleComponentFilter.cs new file mode 100644 index 0000000..fa68072 --- /dev/null +++ b/Google/GoogleComponentFilter.cs @@ -0,0 +1,12 @@ +namespace Geocoding.Google +{ + public class GoogleComponentFilter + { + public string ComponentFilter { get; set; } + + public GoogleComponentFilter(string component, string value) + { + ComponentFilter = string.Format("{0}:{1}", component, value); + } + } +} diff --git a/Google/GoogleComponentFilterType.cs b/Google/GoogleComponentFilterType.cs new file mode 100644 index 0000000..b97a127 --- /dev/null +++ b/Google/GoogleComponentFilterType.cs @@ -0,0 +1,9 @@ +namespace Geocoding.Google +{ + public struct GoogleComponentFilterType + { + public const string AdministrativeArea = "administrative_area"; + public const string PostalCode = "postal_code"; + public const string Country = "country"; + } +} diff --git a/README.md b/README.md index 38357ce..6e1d18e 100644 --- a/README.md +++ b/README.md @@ -5,14 +5,14 @@ Includes a model and interface for communicating with five popular Geocoding pro * [Google Maps](https://developers.google.com/maps/) - [docs](https://developers.google.com/maps/documentation/geocoding/) * [Yahoo! BOSS Geo Services](http://developer.yahoo.com/boss/geo/) - [docs](http://developer.yahoo.com/geo/placefinder/guide/index.html) * [Bing Maps (aka Virtual Earth)](http://www.microsoft.com/maps/) - [docs](http://msdn.microsoft.com/en-us/library/ff701715.aspx) - * :warning: MapQuest [(Comercial API)](http://www.mapquestapi.com/) - [docs](http://www.mapquestapi.com/geocoding/) + * :warning: MapQuest [(Commercial API)](http://www.mapquestapi.com/) - [docs](http://www.mapquestapi.com/geocoding/) * :warning: MapQuest [(OpenStreetMap)](http://open.mapquestapi.com/) - [docs](http://open.mapquestapi.com/geocoding/) The API returns latitude/longitude coordinates and normalized address information. This can be used to perform address validation, real time mapping of user-entered addresses, distance calculations, and much more. See latest [release notes](https://github.com/chadly/Geocoding.net/releases/latest). -:warning: There are some open issues ([#29](https://github.com/chadly/Geocoding.net/issues/29), [#45](https://github.com/chadly/Geocoding.net/issues/45), [#48](https://github.com/chadly/Geocoding.net/issues/48)) regarding MapQuest which have some workarounds. If you would like to help fix the issues, PRs are welcome. +:warning: There is a potential issue ([#29](https://github.com/chadly/Geocoding.net/issues/29)) regarding MapQuest that has a workaround. If you would like to help fix the issue, PRs are welcome. ##Installation @@ -31,8 +31,8 @@ Or download the [latest release](https://github.com/chadly/Geocoding.net/release ```csharp IGeocoder geocoder = new GoogleGeocoder() { ApiKey = "this-is-my-optional-google-api-key" }; IEnumerable
addresses = geocoder.Geocode("1600 pennsylvania ave washington dc"); -Console.WriteLine("Formatted: " + addresses.First().FormattedAddress); //Formatted: 1600 Pennslyvania Avenue Northwest, Presiden'ts Park, Washington, DC 20500, USA -Console.WriteLine("Coordinates: " + addresses.First().Coordinates.Latitude + ", " + addresses.First().Coordinates.Longitude); //Coordinates: 38.8978378, -77.0365123 +Console.WriteLine("Formatted: " + addresses.First().FormattedAddress); //Formatted: 1600 Pennsylvania Ave SE, Washington, DC 20003, USA +Console.WriteLine("Coordinates: " + addresses.First().Coordinates.Latitude + ", " + addresses.First().Coordinates.Longitude); //Coordinates: 38.8791981, -76.9818437 ``` It can also be used to return address information from latitude/longitude coordinates (aka reverse geocoding): diff --git a/examples/Example.Web/Example.Web.csproj b/examples/Example.Web/Example.Web.csproj index 3b3285c..4c086e3 100644 --- a/examples/Example.Web/Example.Web.csproj +++ b/examples/Example.Web/Example.Web.csproj @@ -47,8 +47,9 @@ ..\packages\Autofac.Mvc4.3.1.0\lib\net40\Autofac.Integration.Mvc.dll - - ..\packages\Geocoding.net.3.3.0\lib\net40\Geocoding.dll + + ..\packages\Geocoding.net.3.5.0\lib\net40\Geocoding.dll + True diff --git a/examples/Example.Web/Global.asax.cs b/examples/Example.Web/Global.asax.cs index 715c742..b0432b1 100644 --- a/examples/Example.Web/Global.asax.cs +++ b/examples/Example.Web/Global.asax.cs @@ -7,6 +7,7 @@ using Geocoding.Google; using Geocoding.Microsoft; using Geocoding.Yahoo; +using Geocoding.MapQuest; namespace Example.Web { @@ -36,6 +37,8 @@ IContainer InitializeContainer() //http://developer.yahoo.com/boss/geo/BOSS_Signup.pdf builder.Register(c => new YahooGeocoder("my-yahoo-consumer-key", "my-yahoo-consumer-secret")).As(); + builder.Register(c => new MapQuestGeocoder("mapquest-key") { UseOSM = true }).As(); + //https://developers.google.com/maps/documentation/javascript/tutorial#api_key //a server key is optional with Google builder.Register(c => new GoogleGeocoder diff --git a/examples/Example.Web/Web.config b/examples/Example.Web/Web.config index 40025db..499e401 100644 --- a/examples/Example.Web/Web.config +++ b/examples/Example.Web/Web.config @@ -46,7 +46,7 @@ - + diff --git a/examples/Example.Web/packages.config b/examples/Example.Web/packages.config index add1abc..9f606f1 100644 --- a/examples/Example.Web/packages.config +++ b/examples/Example.Web/packages.config @@ -2,7 +2,7 @@ - + diff --git a/src/Geocoding.Google/BusinessKey.cs b/src/Geocoding.Google/BusinessKey.cs index 433af42..0a6a976 100644 --- a/src/Geocoding.Google/BusinessKey.cs +++ b/src/Geocoding.Google/BusinessKey.cs @@ -1,6 +1,7 @@ using System; using System.Security.Cryptography; using System.Text; +using System.Text.RegularExpressions; namespace Geocoding.Google { @@ -12,10 +13,48 @@ public class BusinessKey public string ClientId { get; set; } public string SigningKey { get; set; } - public BusinessKey(string clientId, string signingKey) + /// + /// More details about channel + /// https://developers.google.com/maps/documentation/directions/get-api-key + /// https://developers.google.com/maps/premium/reports/usage-reports#channels + /// + private string channel; + public string Channel + { + get + { + return channel; + } + set + { + if (string.IsNullOrWhiteSpace(value)) + { + return; + } + string formattedChannel = value.Trim().ToLower(); + if (Regex.IsMatch(formattedChannel, @"^[a-z_0-9.-]+$")) + { + channel = formattedChannel; + } + else + { + throw new ArgumentException("Must be an ASCII alphanumeric string; can include a period (.), underscore (_) and hyphen (-) character", "channel"); + } + } + } + public bool HasChannel + { + get + { + return !string.IsNullOrEmpty(Channel); + } + } + + public BusinessKey(string clientId, string signingKey, string channel = null) { this.ClientId = CheckParam(clientId, "clientId"); this.SigningKey = CheckParam(signingKey, "signingKey"); + this.Channel = channel; } string CheckParam(string value, string name) diff --git a/src/Geocoding.Google/GoogleAddress.cs b/src/Geocoding.Google/GoogleAddress.cs index e8fda16..8f7b283 100644 --- a/src/Geocoding.Google/GoogleAddress.cs +++ b/src/Geocoding.Google/GoogleAddress.cs @@ -10,8 +10,9 @@ public class GoogleAddress : Address readonly GoogleAddressComponent[] components; readonly bool isPartialMatch; readonly GoogleViewport viewport; + readonly string placeId; - public GoogleAddressType Type + public GoogleAddressType Type { get { return type; } } @@ -36,13 +37,18 @@ public GoogleViewport Viewport get { return viewport; } } + public string PlaceId + { + get { return placeId; } + } + public GoogleAddressComponent this[GoogleAddressType type] { get { return Components.FirstOrDefault(c => c.Types.Contains(type)); } } public GoogleAddress(GoogleAddressType type, string formattedAddress, GoogleAddressComponent[] components, - Location coordinates, GoogleViewport viewport, bool isPartialMatch, GoogleLocationType locationType) + Location coordinates, GoogleViewport viewport, bool isPartialMatch, GoogleLocationType locationType, string placeId) : base(formattedAddress, coordinates, "Google") { if (components == null) @@ -53,6 +59,7 @@ public GoogleAddress(GoogleAddressType type, string formattedAddress, GoogleAddr this.isPartialMatch = isPartialMatch; this.viewport = viewport; this.locationType = locationType; - } + this.placeId = placeId; + } } } \ No newline at end of file diff --git a/src/Geocoding.Google/GoogleComponentFilter.cs b/src/Geocoding.Google/GoogleComponentFilter.cs new file mode 100644 index 0000000..fa68072 --- /dev/null +++ b/src/Geocoding.Google/GoogleComponentFilter.cs @@ -0,0 +1,12 @@ +namespace Geocoding.Google +{ + public class GoogleComponentFilter + { + public string ComponentFilter { get; set; } + + public GoogleComponentFilter(string component, string value) + { + ComponentFilter = string.Format("{0}:{1}", component, value); + } + } +} diff --git a/src/Geocoding.Google/GoogleComponentFilterType.cs b/src/Geocoding.Google/GoogleComponentFilterType.cs new file mode 100644 index 0000000..b97a127 --- /dev/null +++ b/src/Geocoding.Google/GoogleComponentFilterType.cs @@ -0,0 +1,9 @@ +namespace Geocoding.Google +{ + public struct GoogleComponentFilterType + { + public const string AdministrativeArea = "administrative_area"; + public const string PostalCode = "postal_code"; + public const string Country = "country"; + } +} diff --git a/src/Geocoding.Google/GoogleGeocoder.cs b/src/Geocoding.Google/GoogleGeocoder.cs index ee0b0b8..8c7f719 100644 --- a/src/Geocoding.Google/GoogleGeocoder.cs +++ b/src/Geocoding.Google/GoogleGeocoder.cs @@ -64,6 +64,7 @@ public BusinessKey BusinessKey public string Language { get; set; } public string RegionBias { get; set; } public Bounds BoundsBias { get; set; } + public IList ComponentFilters { get; set; } public string ServiceUrl { @@ -94,6 +95,11 @@ public string ServiceUrl { builder.Append("&client="); builder.Append(WebUtility.UrlEncode(BusinessKey.ClientId)); + if (BusinessKey.HasChannel) + { + builder.Append("&channel="); + builder.Append(HttpUtility.UrlEncode(BusinessKey.Channel)); + } } if (BoundsBias != null) @@ -108,6 +114,12 @@ public string ServiceUrl builder.Append(BoundsBias.NorthEast.Longitude.ToString(CultureInfo.InvariantCulture)); } + if (ComponentFilters != null) + { + builder.Append("&components="); + builder.Append(string.Join("|", ComponentFilters.Select(x => x.ComponentFilter))); + } + return builder.ToString(); } } @@ -238,6 +250,7 @@ private IEnumerable ParseAddresses(XPathNodeIterator nodes) XPathNavigator nav = nodes.Current; GoogleAddressType type = EvaluateType((string)nav.Evaluate("string(type)")); + string placeId = (string)nav.Evaluate("string(place_id)"); string formattedAddress = (string)nav.Evaluate("string(formatted_address)"); var components = ParseComponents(nav.Select("address_component")).ToArray(); @@ -261,7 +274,7 @@ private IEnumerable ParseAddresses(XPathNodeIterator nodes) bool isPartialMatch; bool.TryParse((string)nav.Evaluate("string(partial_match)"), out isPartialMatch); - yield return new GoogleAddress(type, formattedAddress, components, coordinates, viewport, isPartialMatch, locationType); + yield return new GoogleAddress(type, formattedAddress, components, coordinates, viewport, isPartialMatch, locationType, placeId); } } @@ -361,4 +374,4 @@ private GoogleLocationType EvaluateLocationType(string type) } } } -} +} \ No newline at end of file diff --git a/src/Geocoding.MapQuest/SideOfStreet.cs b/src/Geocoding.MapQuest/SideOfStreet.cs index 29a1675..6dfe15c 100644 --- a/src/Geocoding.MapQuest/SideOfStreet.cs +++ b/src/Geocoding.MapQuest/SideOfStreet.cs @@ -19,5 +19,9 @@ public enum SideOfStreet /// Right /// R, + /// + /// Mixed + /// + M, } } diff --git a/test/Geocoding.Tests/GeocoderTest.cs b/test/Geocoding.Tests/GeocoderTest.cs index 13ae4ec..dca42ed 100644 --- a/test/Geocoding.Tests/GeocoderTest.cs +++ b/test/Geocoding.Tests/GeocoderTest.cs @@ -64,7 +64,9 @@ public virtual void ShouldNotBlowUpOnBadAddress() } [Theory] - [InlineData("Wilshire & Bundy, Los Angeles")] + [InlineData("40 1/2 Road")] + [InlineData("B's Farm RD")] + [InlineData("Wilshire & Bundy Plaza, Los Angeles")] public virtual void CanGeocodeWithSpecialCharacters(string address) { Address[] addresses = geocoder.Geocode(address).ToArray(); @@ -73,6 +75,17 @@ public virtual void CanGeocodeWithSpecialCharacters(string address) Assert.NotEmpty(addresses); } + [Theory] + [InlineData("Wilshire & Centinela, Los Angeles")] + [InlineData("Fried St & 2nd St, Gretna, LA 70053")] + public virtual void CanHandleStreetIntersectionsByAmpersand(string address) + { + Address[] addresses = geocoder.Geocode(address).ToArray(); + + //asserting no exceptions are thrown and that we get something + Assert.NotEmpty(addresses); + } + [Fact] public virtual void CanReverseGeocode() { diff --git a/test/Geocoding.Tests/GoogleBusinessKeyTest.cs b/test/Geocoding.Tests/GoogleBusinessKeyTest.cs index 4ecb3e7..b1f08fe 100644 --- a/test/Geocoding.Tests/GoogleBusinessKeyTest.cs +++ b/test/Geocoding.Tests/GoogleBusinessKeyTest.cs @@ -1,6 +1,7 @@ using System; using Geocoding.Google; using Xunit; +using Xunit.Extensions; namespace Geocoding.Tests { @@ -73,5 +74,55 @@ public void Should_generate_signature_from_url() Assert.NotNull(signedUrl); Assert.Equal("http://maps.googleapis.com/maps/api/geocode/json?address=New+York&sensor=false&client=clientID&signature=KrU1TzVQM7Ur0i8i7K3huiw3MsA=", signedUrl); } + + [Theory] + [InlineData(" Channel_1 ")] + [InlineData(" channel-1")] + [InlineData("CUSTOMER ")] + public void Should_trim_and_lower_channel_name(string channel) + { + var key = new BusinessKey("client-id", "signature", channel); + Assert.Equal(channel.Trim().ToLower(), key.Channel); + } + + [Theory] + [InlineData(null)] + [InlineData("channel_1-2.")] + public void Doesnt_throw_exception_on_alphanumeric_perioric_underscore_hyphen_character_in_channel(string channel) + { + Assert.DoesNotThrow(delegate + { + new BusinessKey("client-id", "signature", channel); + }); + } + + [Theory] + [InlineData("channel 1")] + [InlineData("channel&1")] + public void Should_throw_exception_on_special_characters_in_channel(string channel) + { + Assert.Throws(delegate + { + new BusinessKey("client-id", "signature", channel); + }); + } + + [Fact] + public void ServiceUrl_should_contains_channel_name() + { + var channel = "channel1"; + var key = new BusinessKey("client-id", "signature", channel); + var geocoder = new GoogleGeocoder(key); + + Assert.Contains("channel="+channel, geocoder.ServiceUrl); + } + + [Fact] + public void ServiceUrl_doesnt_contains_channel_on_apikey() + { + var geocoder = new GoogleGeocoder("apikey"); + + Assert.DoesNotContain("channel=", geocoder.ServiceUrl); + } } } \ No newline at end of file diff --git a/test/Geocoding.Tests/GoogleGeocoderTest.cs b/test/Geocoding.Tests/GoogleGeocoderTest.cs index cf8fd00..6617680 100644 --- a/test/Geocoding.Tests/GoogleGeocoderTest.cs +++ b/test/Geocoding.Tests/GoogleGeocoderTest.cs @@ -1,7 +1,8 @@ -using System; +using System; using System.Linq; using Geocoding.Google; using Xunit; +using System.Collections.Generic; namespace Geocoding.Tests { @@ -38,25 +39,25 @@ protected override IGeocoder CreateGeocoder() [InlineData("New York, New York", GoogleAddressType.Locality)] [InlineData("90210, US", GoogleAddressType.PostalCode)] [InlineData("1600 pennsylvania ave washington dc", GoogleAddressType.StreetAddress)] - [InlineData("muswellbrook 2 New South Wales Australia", GoogleAddressType.Unknown)] + [InlineData("muswellbrook 2 New South Wales Australia", GoogleAddressType.Unknown)] public void CanParseAddressTypes(string address, GoogleAddressType type) { GoogleAddress[] addresses = geocoder.Geocode(address).ToArray(); Assert.Equal(type, addresses[0].Type); } - [Theory] - [InlineData("United States", GoogleLocationType.Approximate)] - [InlineData("Illinois, US", GoogleLocationType.Approximate)] - [InlineData("Ingalls Corners Road, Canastota, NY 13032, USA", GoogleLocationType.GeometricCenter)] - [InlineData("51 Harry S. Truman Parkway, Annapolis, MD 21401, USA", GoogleLocationType.RangeInterpolated)] - [InlineData("1600 pennsylvania ave washington dc", GoogleLocationType.Rooftop)] - [InlineData("muswellbrook 2 New South Wales Australia", GoogleLocationType.Approximate)] - public void CanParseLocationTypes(string address, GoogleLocationType type) - { - GoogleAddress[] addresses = geocoder.Geocode(address).ToArray(); - Assert.Equal(type, addresses[0].LocationType); - } + [Theory] + [InlineData("United States", GoogleLocationType.Approximate)] + [InlineData("Illinois, US", GoogleLocationType.Approximate)] + [InlineData("Ingalls Corners Road, Canastota, NY 13032, USA", GoogleLocationType.GeometricCenter)] + [InlineData("51 Harry S. Truman Parkway, Annapolis, MD 21401, USA", GoogleLocationType.RangeInterpolated)] + [InlineData("1600 pennsylvania ave washington dc", GoogleLocationType.Rooftop)] + [InlineData("muswellbrook 2 New South Wales Australia", GoogleLocationType.Approximate)] + public void CanParseLocationTypes(string address, GoogleLocationType type) + { + GoogleAddress[] addresses = geocoder.Geocode(address).ToArray(); + Assert.Equal(type, addresses[0].LocationType); + } [Theory] [InlineData("United States", "fr", "États-Unis")] @@ -89,5 +90,73 @@ public void ApplyBoundsBias(string address, double biasLatitude1, double biasLon GoogleAddress[] addresses = geocoder.Geocode(address).ToArray(); Assert.Equal(result, addresses[0].FormattedAddress); } + + [Theory] + [InlineData("Wimbledon")] + [InlineData("Birmingham")] + [InlineData("Manchester")] + [InlineData("York")] + public void CanApplyGBCountryComponentFilters(string address) + { + geocoder.ComponentFilters = new List(); + + geocoder.ComponentFilters.Add(new GoogleComponentFilter(GoogleComponentFilterType.Country, "GB")); + + GoogleAddress[] addresses = geocoder.Geocode(address).ToArray(); + + Assert.False(addresses.Any(x => x.Components.Any(o => o.ShortName == "US"))); + Assert.True(addresses.Any(x => x.Components.Any(o => o.ShortName == "GB"))); + } + + [Theory] + [InlineData("Wimbledon")] + [InlineData("Birmingham")] + [InlineData("Manchester")] + [InlineData("York")] + public void CanApplyUSCountryComponentFilters(string address) + { + geocoder.ComponentFilters = new List(); + + geocoder.ComponentFilters.Add(new GoogleComponentFilter(GoogleComponentFilterType.Country, "US")); + + GoogleAddress[] addresses = geocoder.Geocode(address).ToArray(); + + Assert.True(addresses.Any(x => x.Components.Any(o => o.ShortName == "US"))); + Assert.False(addresses.Any(x => x.Components.Any(o => o.ShortName == "GB"))); + } + + [Theory] + [InlineData("Washington")] + [InlineData("Franklin")] + public void CanApplyAdministrativeAreaComponentFilters(string address) + { + geocoder.ComponentFilters = new List(); + + geocoder.ComponentFilters.Add(new GoogleComponentFilter(GoogleComponentFilterType.AdministrativeArea, "KS")); + + GoogleAddress[] addresses = geocoder.Geocode(address).ToArray(); + + // Assert we only got addresses in Kansas + Assert.True(addresses.Any(x => x.Components.Any(o => o.ShortName == "KS"))); + Assert.False(addresses.Any(x => x.Components.Any(o => o.ShortName == "MA"))); + Assert.False(addresses.Any(x => x.Components.Any(o => o.ShortName == "LA"))); + Assert.False(addresses.Any(x => x.Components.Any(o => o.ShortName == "NJ"))); + } + + [Theory] + [InlineData("Rothwell")] + public void CanApplyPostalCodeComponentFilters(string address) + { + geocoder.ComponentFilters = new List(); + + geocoder.ComponentFilters.Add(new GoogleComponentFilter(GoogleComponentFilterType.PostalCode, "NN14")); + + GoogleAddress[] addresses = geocoder.Geocode(address).ToArray(); + + // Assert we only got Rothwell, Northamptonshire + Assert.True(addresses.Any(x => x.Components.Any(o => o.ShortName == "Northamptonshire"))); + Assert.False(addresses.Any(x => x.Components.Any(o => o.ShortName == "West Yorkshire"))); + Assert.False(addresses.Any(x => x.Components.Any(o => o.ShortName == "Moreton Bay"))); + } } } \ No newline at end of file diff --git a/test/Geocoding.Tests/MapQuestGeocoderTest.cs b/test/Geocoding.Tests/MapQuestGeocoderTest.cs index 5a43d26..01d1c7c 100644 --- a/test/Geocoding.Tests/MapQuestGeocoderTest.cs +++ b/test/Geocoding.Tests/MapQuestGeocoderTest.cs @@ -1,6 +1,5 @@ using Geocoding.MapQuest; using Xunit; - namespace Geocoding.Tests { [Collection("Settings")] @@ -16,14 +15,7 @@ public MapQuestGeocoderTest(SettingsFixture settings) protected override IGeocoder CreateGeocoder() { return new MapQuestGeocoder(settings.MapQuestKey); - } - - [Theory] - [InlineData("Wilshire & Bundy, Los Angeles")] - [InlineData("Fried St & 2nd St, Gretna, LA 70053")] - public override void CanGeocodeWithSpecialCharacters(string address) - { - base.CanGeocodeWithSpecialCharacters(address); + return new MapQuestGeocoder(k) { UseOSM = false }; } } } diff --git a/test/Geocoding.Tests/YahooGeocoderTest.cs b/test/Geocoding.Tests/YahooGeocoderTest.cs index 7931f2f..c5095f7 100644 --- a/test/Geocoding.Tests/YahooGeocoderTest.cs +++ b/test/Geocoding.Tests/YahooGeocoderTest.cs @@ -47,5 +47,8 @@ public override void CanReverseGeocode() { } [Fact(Skip = "oauth not working for yahoo - see issue #27")] public override void CanGeocodeInvalidZipCodes(string address) { } + + [Fact(Skip = "oauth not working for yahoo - see issue #27")] + public override void CanHandleStreetIntersectionsByAmpersand(string address) { } } }