public static ExerciseSession Create(GpxTrack track) { var exerciseSession = new ExerciseSession { Name = track.Name, Time = track.Time }; ICollection <TrackSegment> trackSegments = new List <TrackSegment>(); foreach (var gpxTrackSegment in track.Segments) { trackSegments.Add(TrackSegment.Create(gpxTrackSegment)); } exerciseSession.Elevation = ElevationProcessor.SessionElevation(trackSegments); exerciseSession.Duration = DurationProcessor.SessionDuration(trackSegments); exerciseSession.Distance = DistanceProcessor.SessionDistance(trackSegments); exerciseSession.Calories = CaloriesProcessor.GetCaloriesBurned(exerciseSession); exerciseSession.Pace = PaceProcessor.GetAveragePace(exerciseSession); exerciseSession.ActivityType = ActivityProcessor.GetActivityType(exerciseSession); exerciseSession.Speed = SpeedProcessor.GetAverageSpeed(exerciseSession); exerciseSession.TrackSegments = trackSegments; return(exerciseSession); }
public void PaceProcessor_ActivityTypeCycling_PaceInMinsPerKm() { _cyclingSession.Pace = PaceProcessor.GetAveragePace(_cyclingSession); Assert.That(_cyclingSession.Pace, Is.EqualTo(new TimeSpan(0, 0, 2, 30))); }