Using full Kestrel server instead of the test server?

260 views Asked by At

While using the test server from the Microsoft.AspNetCore.Mvc.Testing package with code like this

var webAppFactory = new WebApplicationFactory<Program>();
var httpClient = webAppFactory.CreateClient();

I noticed that this is not using a Kestrel server and therefore some things don't work like on a real Kestrel server, e.g. body size limits:

warn: Microsoft.AspNetCore.Mvc.Filters.RequestSizeLimitFilter[1] A request body size limit could not be applied. This server does not support the IHttpRequestBodySizeFeature.

So, how can I run a real Kestrel server during my integration tests?

0

There are 0 answers