public string FunctionHandler(string inputName, ILambdaContext context) { respondModel respond = new respondModel { http_code = "200", http_message = "Success", body = new HelloModel { message = Hello(inputName) } }; return(JsonConvert.SerializeObject(respond)); }
public void TestFunctionMethod() { string expected = "{\"http_code\":\"200\",\"http_message\":\"Success\",\"body\":{\"message\":\"Hello, iFew\"}}"; var function = new Function(); var context = new TestLambdaContext(); respondModel hello_result = function.Handle("iFew", context); string result = JsonConvert.SerializeObject(hello_result); Assert.Equal(expected, result); }