How to add middleware to WebApplicationFactory<TEntryPoint> ? #53999
Unanswered
paulomorgado
asked this question in
Q&A
Replies: 1 comment
-
HI :) Yes, it is possible to add middleware to the application being tested. However, the issue you’re encountering is likely due to the fact that the middleware you added does not call the next middleware in the pipeline. In ConfigureWebHost :
|
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Create a simple web API application project and unit tests:
Change
Program.cs
to make theProgram
class andWeatherForecast
record public:Change
UnitTest1.cs
to be:Run the
WebApiTests.UnitTest1.Test1Async
test and the test succeeds.Change
UnitTest1.cs
to be:Now the test fails with:
Is it not possible to add middleware to the application being tested?
Beta Was this translation helpful? Give feedback.
All reactions