![Mocking Entity Framework 6 - How To Do It, When NOT To Do It](https://d33wubrfki0l68.cloudfront.net/c36cb67e717997f4ae7fc89e969ed16e6e382cfd/958b0/images/posts/mocking-entity-framework_hu81374abff3c527a662e6e7dad9dbbb9c_75772_730x0_resize_q95_h2_box.webp)
Introduction First off, let me make a few assumptions if you’re reading this article and trying to mock with Entity Framework 6:
You’re on a legacy codebase. If you weren’t you’d be using Entity Framework Core and the In-Memory Provider. You’re not utilizing Database Migrations. If you were, it may probably be easier to create a new database and run tests using localDb. Your schema is extremely large. With a large database schema (often seen in legacy systems) data setup can become extremely difficult.
Read more...