In addition to unit tests, you must also create integration tests that run with real database tuning, as was the case during production.
I am not an expert for EF, but with NHibernate, for example, you can create a configuration that points to an instance of SQLite in memory, where you then run quick tests (i.e. during the development cycle, where you want to get through the test suite as much as possible faster). When you want to run your integration tests with a real database, you simply modify the NHibernate configuration to indicate the actual database setup and repeat the same tests again.
It would be surprising if you could not achieve something similar with EF.
source share