Exemplo n.º 1
0
 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);
 }
Exemplo n.º 2
0
        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);
        }
Exemplo n.º 3
0
        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);
        }
Exemplo n.º 4
0
        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);
        }
Exemplo n.º 5
0
 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);
 }