I want to perform integration testing on an Azure Function app (.NET 9 / isolated worker), similar to how it's normally performed using Microsoft.AspNetCore.Mvc.Testing
on ASP.NET Core apps:
.AspNetCore.Mvc.Testing
The Function app is created using an FunctionsApplicationBuilder
:
var builder = FunctionsApplication.CreateBuilder(args);
...
var host = builder.Build()
await host.Run()
For ASP.NET Core apps, I would normally use the testing package above to create an in-memory instance of my web application, with mocked out services, e.g. database, and then call the endpoints using HttpClient.PostAsJsonAsync
.
In case of Function apps, this package doesn't apply, so how would I perform similar testing?