示例#1
0
        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));
        }
示例#2
0
        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();
        }