internal void CalculateReferenceTime_AsSpecificDriver_FromRaceData(ReferenceTimeCalculator referenceTimeCalculator,
                                                                           DriverCodeGenerator driverCodeGenerator,
                                                                           LapDataGenerator lapDataGenerator,
                                                                           string team)
        {
            var(drivers, raceData) = BuildRaceData(driverCodeGenerator, lapDataGenerator, team);
            referenceTimeCalculator.SetStrategy(new SpecificDriverAverageReferenceTimeStrategy(drivers.ToArray()[2].DriverCode));
            var referenceTime = referenceTimeCalculator.Calculate(drivers, raceData);

            Assert.Equal(TimeSpan.FromSeconds(17), referenceTime.Time);
        }
        internal void CalculateReferenceTime_AsWinnerAverage_FromRaceData(ReferenceTimeCalculator referenceTimeCalculator,
                                                                          RaceWinnerAverageReferenceTimeStrategy raceWinnerAverageReferenceTimeStrategy,
                                                                          DriverCodeGenerator driverCodeGenerator,
                                                                          LapDataGenerator lapDataGenerator,
                                                                          string team)
        {
            var(drivers, raceData) = BuildRaceData(driverCodeGenerator, lapDataGenerator, team);
            referenceTimeCalculator.SetStrategy(raceWinnerAverageReferenceTimeStrategy);
            var referenceTime = referenceTimeCalculator.Calculate(drivers, raceData);

            Assert.Equal(TimeSpan.FromSeconds(2), referenceTime.Time);
        }
Ejemplo n.º 3
0
 /// <inheritdoc/>
 public void UseAverageLapTimeFromRaceWinner()
 {
     _referenceTimeCalculator.SetStrategy(new RaceWinnerAverageReferenceTimeStrategy());
     CalculateRaceTrace(CalculateReferenceTime(_driverCollection, _raceData));
 }