you can Mock the DbSet and even use a nice Nuget’s package called FakeDbSet which has a InMemoryDbSet.