Ejemplo n.º 1
0
        public void CityStateCountry()
        {
            var l = LocationParser.ParseLocation("Atlanta, GA, US");

            Assert.AreEqual("Atlanta", l.City);
            Assert.AreEqual("GA", l.State);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        public void Empty()
        {
            var l = LocationParser.ParseLocation("");

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

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