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())); } }
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())); } }