public void A120_GetCarStatistics()
        {
            List <CarStatistic> carStatistics = carsRepository.GetCarStatistics();

            Assert.AreEqual(numberOfCarsCategoryStatRows, carStatistics.Count);
            Assert.AreEqual(CarCategory.N400, carStatistics[expectedN400Row].Category);
            Assert.AreEqual(N400NumberOfCars, carStatistics[expectedN400Row].NumberOfCars);
            Assert.AreEqual(N400AvgMaxPower, carStatistics[expectedN400Row].AvgMaxPower);
            Assert.AreEqual(N400AvgMaxSpeed, carStatistics[expectedN400Row].AvgMaxSpeed);
            Assert.AreEqual(N400AvgAcceleration, carStatistics[expectedN400Row].AvgAcceleration);
            Assert.AreEqual(N400AvgBraking, carStatistics[expectedN400Row].AvgBraking);
            Assert.AreEqual(N400AvgCornering, carStatistics[expectedN400Row].AvgCornering);
            Assert.AreEqual(N400AvgStability, carStatistics[expectedN400Row].AvgStability);
            Assert.AreEqual(N400AvgPrice, carStatistics[expectedN400Row].AvgPrice);
        }
Exemple #2
0
        private void AddCarStatistics(ref List <GTSportStatistic> statistics)
        {
            List <CarStatistic> carStatistics = carsRepository.GetCarStatistics();

            foreach (CarStatistic carStatistic in carStatistics)
            {
                foreach (GTSportStatistic statistic in statistics)
                {
                    if (statistic.Category == carStatistic.Category)
                    {
                        statistic.AvgMaxSpeed     = Math.Round(carStatistic.AvgMaxSpeed, 1);
                        statistic.AvgAcceleration = Math.Round(carStatistic.AvgAcceleration, 1);
                        statistic.AvgBraking      = Math.Round(carStatistic.AvgBraking, 1);
                        statistic.AvgCornering    = Math.Round(carStatistic.AvgCornering, 1);
                        statistic.AvgMaxPower     = Math.Round(carStatistic.AvgMaxPower, 0);
                        statistic.AvgPrice        = Math.Round(carStatistic.AvgPrice, 2);
                        statistic.AvgStability    = Math.Round(carStatistic.AvgStability, 1);
                        statistic.NumberOfCars    = carStatistic.NumberOfCars;
                    }
                }
            }
        }