Start here. This is the direct spoken answer to practice first.
Why this question matters
A handler can be correct while routing, middleware order, model binding, authentication, or serialization is wrong. Hosting the application catches those composition failures.
I derive a custom WebApplicationFactory<Program>, create an HttpClient, and call the API over HTTP. The test boots the real service registration and request pipeline with test configuration. I replace external services and the database only through explicit test registrations, then assert status code, headers, and response contract rather than calling the endpoint method directly.