public void NearestThousand1500() { int input = 1500; int expected = 2000; int actual = VeryComplexMathEngine.RoundToNearestThousand(input); Assert.AreEqual(expected, actual); }
public void NearestThousandMax() { int input = 2147483647; int expected = 2147483000; int actual = VeryComplexMathEngine.RoundToNearestThousand(input); Assert.AreEqual(expected, actual); }
public void NearestThousandVeryNegative() { int input = -143679897; int expected = 0; int actual = VeryComplexMathEngine.RoundToNearestThousand(input); Assert.AreEqual(expected, actual); }
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)); }