AutoFixture/AutoFixture — pull request #330 by dcastro (2014-12-14 18:07:26+00:00)
Title: Refactor mocking strategies

This PR aims to clean up the `MockType` static class.

At the moment, this class contains a few utility extension methods related to the `Mock`/`Mock` classes and some strategies for setting up mocks.
It seems to me defining mocking strategies should not be `MockType`'s responsibility. As new strategies are added, this class will get cluttered.
Also, there is no easy way for users to define their own strategies without having to re-write the command that uses it completely.

In my opinion, the simplest way to solve these problems is to move the strategy into its respective command, as @mrinaldi did here: #308
If these methods are made `protected virtual`, users can simply extend the command.

E.g., to generate new values every time the method is called, instead of using memoization, simply:

```csharp
public class CustomMockVirtualMethodCommand
{
protected override void SetupMethod( /* ... */ )
{
mock.Setup(methodCallExpression)
.Returns(x => (TResult) context.Resolve(typeof(TResult)));
}
}
```