Example #1
0
        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);
        }
Example #3
0
        public void Empty()
        {
            var l = LocationParser.ParseLocation("");

            Assert.AreEqual("", l.State);
        }
Example #4
0
        public void StateOnly()
        {
            var l = LocationParser.ParseLocation("GA");

            Assert.AreEqual("GA", l.State);
        }