public void CityStateCountry() { var l = LocationParser.ParseLocation("Atlanta, GA, US"); Assert.AreEqual("Atlanta", l.City); Assert.AreEqual("GA", l.State); }
public TrackingData GetTrackingData(string trackingNumber) { var trackingData = _baseTracker.GetTrackingData(trackingNumber); if (trackingData.Activity != null && trackingData.Activity.Count > 0) { foreach (var activity in trackingData.Activity) { if (!string.IsNullOrWhiteSpace(activity.LocationDescription)) { var address = LocationParser.ParseLocation(activity.LocationDescription); var cityDetails = Geocode(address); if (cityDetails != null) { activity.Latitude = cityDetails.Latitude; activity.Longitude = cityDetails.Longitude; } } } } return(trackingData); }
public void Empty() { var l = LocationParser.ParseLocation(""); Assert.AreEqual("", l.State); }
public void StateOnly() { var l = LocationParser.ParseLocation("GA"); Assert.AreEqual("GA", l.State); }