Invoke() private method

private Invoke ( InvokeRequest request ) : InvokeResponse
request Amazon.Lambda.Model.InvokeRequest
return Amazon.Lambda.Model.InvokeResponse
        public void TestInvokeResponseBody()
        {
            var responseBody = "Process exited before completing request:TypeError: Object #<LambdaEventResponse> has no method 'write': at exports.handler (/var/task/helloworld.js:4:14)";
            var requestId = "fakerequ-esti-dfak-ereq-uestidfakere";

            using(var client = new Amazon.Lambda.AmazonLambdaClient(new Amazon.Runtime.AnonymousAWSCredentials(), RegionEndpoint.USEast1))
            {
                CustomResponses.SetResponse(client, responseBody, requestId, isOK: true);

                var response = client.Invoke(new InvokeRequest
                {
                });
                Assert.AreEqual(requestId, response.ResponseMetadata.RequestId);
                Assert.AreEqual(responseBody, Encoding.UTF8.GetString(response.Payload.ToArray()));
            }
        }
示例#2
0
        public void TestInvokeResponseBody()
        {
            var responseBody = "Process exited before completing request:TypeError: Object #<LambdaEventResponse> has no method 'write': at exports.handler (/var/task/helloworld.js:4:14)";
            var requestId    = "fakerequ-esti-dfak-ereq-uestidfakere";

            using (var client = new Amazon.Lambda.AmazonLambdaClient(new Amazon.Runtime.AnonymousAWSCredentials(), RegionEndpoint.USEast1))
            {
                CustomResponses.SetResponse(client, responseBody, requestId, isOK: true);

                var response = client.Invoke(new InvokeRequest
                {
                });
                Assert.AreEqual(requestId, response.ResponseMetadata.RequestId);
                Assert.AreEqual(responseBody, Encoding.UTF8.GetString(response.Payload.ToArray()));
            }
        }