Exemple #1
0
        public void Track_Compare_ToGeoFile_Conversion()
        {
            // ARRANGE
            Int32 origionalCount   = 0;
            Int32 transformedCount = 0;

            // ACT
            origionalCount   = gpxTrackFile.Tracks[0].TrackSegments[0].TrackPoints.Count; // Count of origional
            transformedCount = gpxTrackFile.ToGeoFile().Routes[0].Points.Count;           // Do conversion and count

            // ASSERT
            origionalCount.Should().Be(transformedCount);
        }
Exemple #2
0
        public void File_Format_Compare_Distance()
        {
            // ARRANGE
            GeoFile tcxConversion = tcxTrackFile.ToGeoFile();
            GeoFile gpxConversion = gpxTrackFile.ToGeoFile();

            // ACT
            Double tcxDistance = Math.Round(tcxConversion.Routes[0].Points.CalculateTotalDistance(), 0);
            Double gpxDIstance = Math.Round(gpxConversion.Routes[0].Points.CalculateTotalDistance(), 0);

            // ASSERT
            tcxDistance.Should().Be(gpxDIstance);
        }
Exemple #3
0
        public void Split_Track_By_TimeSpan_Middle()
        {
            // ARRANGE
            GeoFile gpxConversion = gpxTrackFile.ToGeoFile();
            List <List <GeoCoordinateExtended> > result;
            TimeSpan splitTime   = new TimeSpan(1, 0, 0);                                 // 1 hour split for a half marathon seems reasonables
            DateTime compareTime = gpxConversion.Routes[0].Points[0].Time.Add(splitTime); // Work out the actual time of the split

            // ACT
            result = gpxConversion.Routes[0].Points.Split(splitTime);
            DateTime part1EndTime   = result[0][result[0].Count - 1].Time;
            DateTime part2StartTime = result[1][0].Time;

            // ASSERT
            part1EndTime.Ticks.Should().BeLessThan(compareTime.Ticks);
            part1EndTime.Ticks.Should().BeLessThan(part2StartTime.Ticks);
            part2StartTime.Ticks.Should().BeGreaterThan(compareTime.Ticks);
        }