I am trying to use the EF7 InMemory provider for unit tests, but the persistent nature of the InMemory database between tests is causing me problems.
The following code d
Bit late to the party, but i also ran into the same issue but what i ended up doing was.
Specifying a different database name for each test.
optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString());
That way you dont have to add
_context.Database.EnsureDeleted();
in all your tests