public IHttpActionResult TrainLoadCalculations(TrainLoadInputDTO inputDTO) { var input = inputDTO.ToTrainLoadInput(); var calculator = new TrainLoadCalculator(input); var result = calculator.Calculate(); var resultDTO = result.ToTrainLoadOutputDTO(); return(Ok(resultDTO)); }
static void Main(string[] args) { var trainLoadInput = JsonConvert.DeserializeObject <TrainLoadInput>(MockedData.Input); var trainLoadCalculator = new TrainLoadCalculator(trainLoadInput); var result = trainLoadCalculator.Calculate(); var resultTxt = JsonConvert.SerializeObject(result); var isOK = resultTxt == MockedData.Output; Console.WriteLine(isOK); Console.Read(); }