public void PaceFromSpeed_ShowWithoutHours() { var speed = 11.66666666666667;//m/s var pace = WilksFormula.SpeedToPace((float)speed); Assert.AreEqual("01:25", WilksFormula.PaceToString(pace, true)); }
public void PaceFromDistanceAndTime() { var pace = TimeSpan.FromMinutes(50).TotalSeconds / 35; var paceTimeString = WilksFormula.PaceToString((float)pace); Assert.AreEqual("00:01:25", paceTimeString); }
public void PaceFromSpeed() { var speed = 11.66666666666667;//m/s var pace = WilksFormula.SpeedToPace((float)speed); Assert.AreEqual("00:01:25", WilksFormula.PaceToString(pace)); }
public void SpeedToPace() { var speed = 12;//m/s var pace = WilksFormula.SpeedToPace((float)speed); Assert.AreEqual("01:23", WilksFormula.PaceToString(pace, true)); //min/km pace = WilksFormula.SpeedToPace((float)speed, true); Assert.AreEqual("02:15", WilksFormula.PaceToString(pace, true)); //min/mile }
void fillInfo() { pivot.Items.Remove(tpWorkout); if (!pivot.Items.Contains(tpSummary)) { pivot.Items.Add(tpSummary); } pivot.SelectedItem = tpSummary; if (viewModel.Entry.Duration.HasValue) { tbSummaryDuration.Text = viewModel.Entry.Duration.Value.ToDisplayDuration().ToString(); } tbSummaryExercise.Text = viewModel.Entry.Exercise.Name; if (viewModel.HasDistance) { tbSummaryDistance.Text = viewModel.Entry.Distance.Value.ToDisplayDistance().ToString("0.##"); } if (viewModel.HasMaxSpeed) { tbSummaryMaxSpeed.Text = viewModel.Entry.MaxSpeed.Value.ToDisplaySpeed().ToString("0.##"); } if (viewModel.HasAvgSpeed) { tbSummaryAvgSpeed.Text = viewModel.Entry.AvgSpeed.Value.ToDisplaySpeed().ToString("0.##"); tbSummaryAvgPace.Text = WilksFormula.PaceToString((float)viewModel.Entry.AvgSpeed.Value.ToDisplayPace(), true); } if (viewModel.HasMaxAlt) { tbSummaryMaxAltitude.Text = viewModel.Entry.MaxAltitude.Value.ToDisplayAltitude().ToString("0.#"); } if (viewModel.HasMinAlt) { tbSummaryMinAltitude.Text = viewModel.Entry.MinAltitude.Value.ToDisplayAltitude().ToString("0.#"); } if (viewModel.HasCalories) { tbSummaryCalories.Text = Math.Round(viewModel.Entry.Calories.Value).ToString(); } if (viewModel.HasWeather) { var image = new BitmapImage(new Uri(string.Format("/Images/Weather/{0}", WeatherIcon.GetIcon(viewModel.Entry.Weather.Condition)), UriKind.RelativeOrAbsolute)); imgWeather.Source = image; if (viewModel.Entry.Weather.Temperature.HasValue) { tbSummaryTemperature.Text = viewModel.Entry.Weather.Temperature.Value.ToString(); } } }