I'm new to ASPNET Core API integration testing. I'm using a custom WebApplicationFactory to spin up my API project and replace the SQLServer DbContext with an InMemoryDatabase. This works fine but I'd like each of my tests to have a clean database but currently my database is setup only at the beginning and is used throughout all the tests. I've search for hours on Google but cannot find any references on how to accomplish this. Do any of you know how to do this?
โ04-19-2021 08:26 PM
โ05-20-2021 02:18 AM