Unit test Data Access Layer (Entity Framework) with in-memory database

2
Comments
Unit test Data Access Layer (Entity Framework) with in-memory database

Unit testing code that uses data from database is a difficult task. If you use Entity Framework you can stub your data with Effort - in-memory Entity Framework data provider. David Bywaters describes how to use Effort if your create you context based in DbContext class. But if you use model first approach (.edmx already exists) you can follow this guide: First of all install Effort from NuGet: Install-Package Effort -Pre Then add add App.Config file to your unit test project. App.Config file sho...

Read further...