Testing with a mocking framework - EF6
Testing with a mocking framework in Entity Framework 6