Skip to content

Commit

Permalink
add wip test
Browse files Browse the repository at this point in the history
  • Loading branch information
satvu committed Dec 19, 2024
1 parent be72661 commit b7c66fd
Showing 1 changed file with 18 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,24 @@ public async Task InvocationResultNull_WhenResultIsTypeAspNetCoreHttpResponseDat
test.MockCoordinator.Verify(p => p.CompleteFunctionInvocation(It.IsAny<string>()), Times.Once());
}

[Fact]
public async Task HttpResultOutputBindingNull_WhenUsingAspNetCoreHttpResponseDataInMultiOutputBinding()
{
var test = SetupTest("httpTrigger");
var mockDelegate = new Mock<FunctionExecutionDelegate>();

SetUpAspNetCoreHttpResponseDataBindingInfo(test.FunctionContext, false);

var funcMiddleware = new FunctionsHttpProxyingMiddleware(test.MockCoordinator.Object);
await funcMiddleware.Invoke(test.FunctionContext, mockDelegate.Object);

var httpOutputBinding = test.FunctionContext.GetOutputBindings<object>()
.FirstOrDefault(a => string.Equals(a.BindingType, "http", StringComparison.OrdinalIgnoreCase));

Assert.Null(httpOutputBinding.Value);
test.MockCoordinator.Verify(p => p.CompleteFunctionInvocation(It.IsAny<string>()), Times.Once());
}

private static (FunctionContext FunctionContext, HttpContext HttpContext, Mock<IHttpCoordinator> MockCoordinator) SetupTest(string triggerType, IDictionary<string, BindingMetadata> outputBindings = null)
{
var inputBindings = new Dictionary<string, BindingMetadata>()
Expand Down

0 comments on commit b7c66fd

Please sign in to comment.