Closed
Description
Description
I would like to give the integration tests in this project a big overhaul. Things I would like to address:
- Use WebApplicationFactory instead of TestServer
- Update Startup/Program from IWebHostBuilder to IHostBuilder
- Use a centralized set of typed deterministic (based on test name) Fakers and reuse them
- Use FluentAssertions for more readable tests and better failure messages
- Create a shared project with common building blocks, like executing a request, replacing an injected service etc.
- Have unit tests that assert exact json-text output (guards against breaking changes)
I'm also thinking about running tests in parallel.
- Each test class has its own database and factory, so classes can run in parallel
- Within a test class, use a unique database name (guid appended) and server instance, then run its containing test methods sequentially on that