WebApplicationFactory is an ASP.NET Core testing API that creates an in-memory host for a web service and supplies an HttpClient for requests against it. Creating the client starts the service, allowing configuration, dependency injection, controllers, and application logic to be exercised together in one process. section 8.5
A practical integration-test setup typically:
- Removes the existing HttpClient registration and adds a client configured with a fake HttpMessageHandler when external HTTP calls must stay in-process. section 8.5
Testing a search endpoint
Configure the fake message handler with comics, create the factory client, and request /search?searchText=b. Assert an OK response, deserialize the content, and verify that only comic number 12 is returned.

