Exemple #1
0
        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));
        }
Exemple #2
0
        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);
        }