Skip to content

Integration Testing Azure Durable Function #2613

Closed Answered by theplankmeister
theplankmeister asked this question in Q&A
Discussion options

You must be logged in to vote

After many days of frustration, I found the answer. I found it in the AzureFunctions.TestHelpers project. Basically, the only thing I was missing, was a single (but important) line of code. In my integration test fixture class, there where I configure my HostBuilder, all I needed to do was invoke:

hostBuilder = new HostBuilder()
    .ConfigureWebJobs(...)
    ... // More configuration goes here
    .Build();

await hostBuilder.StartAsync(); // This is the magic line.

...and that was it, it started working. Along with the other IJobHost extension methods provided by AzureFunctions.TestHelpers to properly manage the jobs, everything works as expected, which means I can run completely encaps…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by theplankmeister
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant