Quick project to demostrate how to do integration tests with EF In memory database and bogus library
Webpi core project based on .Net 5 and Postgres database setup with EFCore as ORM.
- Run InitialCreate migration on local Postgres database. Connection string is in appsettings.json and username is default for postgres databases
- Build and Run the solution
You can run the dockerfile to startup a container with postgres image.
Main integration tests are in PersonsControllerTest, go to test explorer and run them all. BaseWebApplicationFactory
contains the recreation of the Startup class to define the database in memory and fake data using bogus