private GeolocatorResponse CreateGeolocationResponse(MapquestGeolocationResponse mapquestResponse) { EnsureMapquestResponseContainsGeolocation(mapquestResponse); var geoResponse = new GeolocatorResponse(); geoResponse.LatitudeLongitude.Latitude = mapquestResponse.Results.First().Locations.First().LatitudeLongitude.Latitude; geoResponse.LatitudeLongitude.Longitude = mapquestResponse.Results.First().Locations.First().LatitudeLongitude.Longitude; return(geoResponse); }
private void EnsureMapquestResponseContainsGeolocation(MapquestGeolocationResponse mapquestResponse) { if (mapquestResponse.Results.FirstOrDefault() == null) { throw new GetARyderEmptyGeolocationException("Mapquest did not return any results when attempting to geolocate."); } if (mapquestResponse.Results.First().Locations.FirstOrDefault() == null) { throw new GetARyderEmptyGeolocationException("Mapquest did not return any locations when attempting to geolocate."); } }
public void SetMapquestGeolocationResponse(MapquestGeolocationResponse mapquestGeolocationResponse) { ExpectedMapquestGeolocationResponse = mapquestGeolocationResponse; }