Ejemplo n.º 1
0
        public void Ensure_TotalDistance_is_correct_with_two_points()
        {
            var coords = new GeoCoordinate[]
            {
                new GeoCoordinate(20, 80),
                new GeoCoordinate(10, 90)
            };

            var expectedDistance = (decimal)coords.ElementAt(0).GetDistanceTo(coords.ElementAt(1));
            var xml = new XDocument(new XElement("VIEWRANGER",
                                                 coords.Select(c => new XElement("LOCATION",
                                                                                 new XElement("LATITUDE", c.Latitude),
                                                                                 new XElement("LONGITUDE", c.Longitude)))));
            var track = this.GetTrackFromResponse(xml);

            Assert.AreEqual(expectedDistance, track.TotalDistance);
        }