Geeks With Blogs

The Life and Times of a Dev Yes, we're really that weird Entity Framework
Testing EntityFramework with Moq
Let’s face it, EntityFramework is a pain to mock. With few interfaces, testing things that use it can be a real pain. Here’s a few things I’ve found to make it easier: Make sure that you have an interface for your DbContext object so that it can easily be mocked. If you’re doing Database First, be aware that EF 7 will eliminate EDMX support, so welcome to the code first era (I hear you . . .). Rather than using your Dependency Injector to directly inject an instance of your IDbContext, create a context ......

Posted On Thursday, November 20, 2014 4:06 PM

Copyright © Robert May | Powered by: GeeksWithBlogs.net