Tim Deschryver

link Refactor Functional Tests to support Minimal Web APIs

Refactor Functional Tests to support Minimal Web APIs

profile
Tim Deschryver
timdeschryver.dev

When you're migrating an existing codebase to use the new ASP.NET 6 Minimal Web API structure or if you're writing your first test, then you might notice that the setup of a functional test is a tiny bit different.

Because we're testing the application from the outside, and not its internal details, the tests should be green after these changes.

Make Program public link

Use the Program type (instead of Startup) to create a WebApplicationFactory link

Feel free to update this blog post on GitHub, thanks in advance!

Join My Newsletter (WIP)

Join my weekly newsletter to receive my latest blog posts and bits, directly in your inbox.

Support me

I appreciate it if you would support me if have you enjoyed this post and found it useful, thank you in advance.

Buy Me a Coffee at ko-fi.com PayPal logo

Share this post