If you are using the NMock mock objects framework, you are probably familiar with the following syntax:
Stub.On(...).Method(...).Will(Return.Value(...));
This will cause your mock object to return a specific value from some invoked method.
Now, for something less not documented:
To mock a method that sets value of an out parameter, use:
Stub
.On(...).Method(...).Will(new SetNamedParameterAction([parameter name], [value])); You can also use the SetIndexedParameterAction class.
This is not in the documentation, so using Reflector on the NMock2.dll helped find this.