The comments to the question ought to answer the original question of why, but then there's the follow-up comment:
It would be nice, though, to have an easy way to disable [recursive mocks].
It's not that hard to do. If you look at the implementation of AutoMoqCustomization
, it's the use of MockPostProcessor
that turns on recursive mocks. If you don't want that, you can create your own Customization that doesn't do that:
public class AutoNonRecursiveMoqCustomization : ICustomization
{
public void Customize(IFixture fixture)
{
if (fixture == null)
throw new ArgumentNullException("fixture");
fixture.Customizations.Add(
new MethodInvoker(
new MockConstructorQuery()));
fixture.ResidueCollectors.Add(new MockRelay());
}
}
MockPostprocessor
also sets CallBase
to true
, so by omitting MockPostprocessor
you also disable that CallBase
setting.