Is there any way to create a separate (isolated) instance of an EF7 In Memory Database? I am using the In Memory Database in Entity Framework 7 in my unit tests written in xUnit. I would like to be able to run the tests in parallel but this isn't really possible since it seems like the same in memory database is used for all the tests. What I would like is for each test to have its on isolated in memory database that isn't shared with the other tests that run in parallel.
In EF Core you can pass a db name for InMemory db context.
Something like
var builder = new DbContextOptionsBuilder();
builder.UseInMemoryDatabase($"database{Guid.NewGuid()}");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With