Hi Michael
you propose that for returning ref and out parameters I can use DynamicReturnValues.
What about void methods with ref and out parameters. How do I handle these? Any example?
There are two ways to mock ref and out arguments.
1. Use the Assign class as follows:
mock.ExpectCall("DoSomething").Args(new Assign("New String").AndCheck("TypeMock"));
Here we are both checking the the first argument is "TypeMock" and we will change it to "New String".
2. Use the DynamicReturnValues (it can be used for void methods too)
mock.ExpectAndReturn("DoSomething",new DymanicReturnValue(Method));
In the Method we can perform our checks and change ref and out values.