Search code examples
moqstructuremap3

How do I use the MoqAutoMocker auto mocker with StructureMap 3?


I'm trying to get familiar with unit testing with StructureMap, and am attempting to use the built-in auto mocker for Moq that appears to come with StructureMap. I installed the NuGet package using the directions

Install-Package StructureMap

and it installed and SM working fine. The repository clearly has the MoqAutoMocker code in it, but the StructureMap.AutoMocker.Moq namespace is nowhere to be found:

The object graph I see to demonstrate the AutoMocker implementations don't appear to exist.

I've checked out several examples that make this seem very easy to do, but they're a couple years old and seem focused on previous versions of SM, but I'm hopeful there's just something I don't see yet:

http://joelabrahamsson.com/setting-expectations-with-structuremaps-moqautomocker/ http://evolutionarydeveloper.blogspot.com/2012/10/automock-with-structuremap-and-moq.html

Is there something obvious I'm missing here?


Solution

  • You'll need structuremap.automocking.moq package. Check this out: http://www.nuget.org/packages?q=structuremap.automocking