public string ProcessRequest(string request) { var jsonRequest = JsonRequest.Parse(request); object response = InvokeMethod(jsonRequest.MethodName, jsonRequest.DeserializedArgs); return(JsonResponse.SerializeResponse(response)); }
public void Parse_DeseralizeException_ThrowsParseException() { var invalid_json = "invalid json"; var response = new NetworkResponse { Data = Encoding.UTF8.GetBytes(invalid_json), Headers = new WebHeaderCollection(), }; _mock_serializer. Setup(m => m.Deserialize <int>(invalid_json)). Throws <SerializationException>(); Xunit.Assert.Throws <ParseException>(() => _request.Parse(response)); }