1
Vote

Moq 4.0 Is Needed(AutoFixture Won't work with EF 6)

description

Hi

I been playing around for hours now trying to figure out why the new way of mocking is not working in Entity Framework 6 RC-1

I started off by installing the autofixture for moq from nuget and tried to get it work.

I then found this tutorial do the mocking with just moq and EF 6 but it still did not work.

Turns out that moq 3 fails and you need moq 4 to make what their doing work in the tutorial.

I never really used AutoFixture before but I am hoping that if moq 4 would be used and Autofixture would be updated so that it works with moq 4 then everything would just work.

comments

baxevanis wrote Oct 12, 2013 at 2:09 PM

FWIW, there is not version-specific constraint in Moq. You may use Moq 4 with AutoFixture.AutoMoq.

You can do this by first installing Moq 4, and then AutoFixture.AutoMoq or by updating to the latest version of Moq and adding (or updating) the assembly binding redirection.

ploeh wrote Oct 13, 2013 at 8:50 AM

If you use the NuGet package manager console, it's easy to make AutoFixture.AutoMoq work with Moq 4.
> install-package AutoFixture.AutoMoq
> update-package
> add-bindingredirect
Instead of mucking around with XML files etc., the add-bindingredirect command takes care of that for you.

baxevanis wrote Oct 13, 2013 at 10:11 AM

Indeed. Much more ..2013 style :)