コード例 #1
0
        public void NearestThousand1500()
        {
            int input    = 1500;
            int expected = 2000;
            int actual   = VeryComplexMathEngine.RoundToNearestThousand(input);

            Assert.AreEqual(expected, actual);
        }
コード例 #2
0
        public void NearestThousandMax()
        {
            int input    = 2147483647;
            int expected = 2147483000;
            int actual   = VeryComplexMathEngine.RoundToNearestThousand(input);

            Assert.AreEqual(expected, actual);
        }
コード例 #3
0
        public void NearestThousandVeryNegative()
        {
            int input    = -143679897;
            int expected = 0;
            int actual   = VeryComplexMathEngine.RoundToNearestThousand(input);

            Assert.AreEqual(expected, actual);
        }
コード例 #4
0
ファイル: CarsController.cs プロジェクト: foolmoron/RideWizz
        public ActionResult Index(int id = 14)
        {
            var allCars = carRepository.GetAll(id);
            var allCarsRoundedMileage = allCars.Select(car => {
                car.Mileage = VeryComplexMathEngine.RoundToNearestThousand(car.Mileage);
                return(car);
            });
            var model = new CarsOutputModel {
                AllCars = allCarsRoundedMileage
            };

            return(View(model));
        }