public void CalculateNormalizedPower_With_No_Samples_Returns_Zero() { var samples = new WorkoutSamples(0); IAthlete athlete = new Athlete(); var workoutCalculator = new WorkoutSamplesCalculator(samples,athlete); var average = workoutCalculator.GetNormalizedPower(); Assert.Equal(0, average); }
public void CalculateNormalizedPower_With_No_Samples_Returns_Zero() { var samples = new WorkoutSamples(0); IAthlete athlete = new Athlete(); var workoutCalculator = new WorkoutSamplesCalculator(samples, athlete); var average = workoutCalculator.GetNormalizedPower(); Assert.Equal(0, average); }
public void TestNormalizedPower() { Initialise(); var calc = new PWXDataExtractor(_test); var workoutSample = calc.ExtractData(); IAthlete athlete = new Athlete(); var workoutCalculator = new WorkoutSamplesCalculator(workoutSample, athlete); var myPowerAverage = workoutCalculator.GetNormalizedPower(); Assert.Equal(231, myPowerAverage); }
public static IWorkout MapExtendedCycleWorkout(pwx pwx, IWorkout shortWorkout) { pwxWorkout pwxWo = pwx.workout[0]; IAthlete athlete = new Athlete(); athlete.FTBikePower = 231; shortWorkout.TrainingStressScore = pwxWo.summarydata.tss; ICycleWorkout cycleWorkout = shortWorkout as ICycleWorkout; if (cycleWorkout == null) { return(shortWorkout); } PWXDataExtractor dataExtractor = new PWXDataExtractor(pwx); var workoutSamples = dataExtractor.ExtractData(); WorkoutSamplesCalculator calc = new WorkoutSamplesCalculator(workoutSamples, athlete); cycleWorkout.IntensityFactor = calc.CalcualteIntensityFactor(); cycleWorkout.NormalizedPower = (int)calc.GetNormalizedPower(); return(shortWorkout); }