public void GetAllVehicleTypes_Test() { //arrange //act //assert Assert.IsType <List <VehicleType> >(VehicleType.GetAllVehicleTypes()); }
public ActionResult ViewFares() { try { ViewFaresViewModel model = new ViewFaresViewModel(); foreach (var item in VehicleType.GetAllVehicleTypes()) { Fare fare = item.GetCurrentFare(); model.CurrentFareInfo.Add(new FareInfo { DateOfInclusion = UISupportiveFunctions.GetPassedDateSpanFromNow(fare.Date), DistanceTravelledPerKmFee = decimal.Round(fare.DistanceTravelledPerKm, 2), DropOffFee = decimal.Round(fare.DropOffFare, 2), Gst = fare.GSTPercent, PickUpFee = decimal.Round(fare.PickUpFare, 2), ServiceCharges = fare.ServiceChargesPercent, VehicleType = item.Name }); } foreach (var fareHistory in Fare.GetAllFares()) { model.UpdationHistory.Add(new FareInfo { DateOfInclusion = UISupportiveFunctions.GetPassedDateSpanFromNow(fareHistory.Date), DistanceTravelledPerKmFee = decimal.Round(fareHistory.DistanceTravelledPerKm, 2), DropOffFee = decimal.Round(fareHistory.DropOffFare, 2), Gst = fareHistory.GSTPercent, PickUpFee = decimal.Round(fareHistory.PickUpFare, 2), ServiceCharges = fareHistory.ServiceChargesPercent, VehicleType = fareHistory.VehicleType.Name }); } return(View(model)); } catch (Exception ex) { return(RedirectToAction("ErrorPage", "Error", ex)); } }