public static JObject ValidResponse(string id)
        {
            var daResponse = new ValidResponseModel {
                displayName               = id.ToUpper(),
                statusSeverity            = "Good",
                statusSeverityDescription = "No Exceptional Delays"
            };

            return(JObject.Parse(Newtonsoft.Json.JsonConvert.SerializeObject(daResponse)));
        }
Example #2
0
        public string BuildResponse(JObject jObject)
        {
            StringBuilder response = new StringBuilder();

            var responseModel = new ValidResponseModel
            {
                displayName               = (string)jObject["displayName"],
                statusSeverity            = (string)jObject["statusSeverity"],
                statusSeverityDescription = (string)jObject["statusSeverityDescription"]
            };

            response.AppendLine("The status of the " + responseModel.displayName + " is as follows");
            response.AppendLine("Road status is " + responseModel.statusSeverity);
            response.AppendLine("Road status Description is " + responseModel.statusSeverityDescription);

            return(response.ToString());
        }