grpc-dotnet
grpc-dotnet copied to clipboard
Integration test with minimal APIs
@JamesNK how to write integration tests with minimal APIs?
@listepo Please use the following guide: https://docs.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-6.0
https://docs.microsoft.com/en-us/aspnet/core/migration/50-to-60-samples?view=aspnetcore-6.0#test-with-webapplicationfactory-or-testserver is a migration guide if you're starting from an existing project.
If I'm not mistaken this is an example/docs for Microsoft.AspNetCore.Mvc.Testing, but not grpc-dotnet
https://docs.microsoft.com/en-us/aspnet/core/grpc/test-services?view=aspnetcore-6.0
@JamesNK thanks, but this example uses GrpcTestFixture<TStartup>
, minimal APIs does not use TStartup)
Triage: We need to update the docs and provide a test example with WebApplicationFactory
. @listepo Can you look at the following doc? It has some guidance on how to test with a minimal host: https://docs.microsoft.com/aspnet/core/test/integration-tests?view=aspnetcore-6.0#basic-tests-with-the-default-webapplicationfactory
I already figured it out, thanks everyone