I just switched to Moq and have run into a problem. I\'m testing a method that creates a new instance of a business object, sets the properties of the object from user inpu
Unfortunately, I am not sure that this is possible without direct support from Moq. The problem is that Lambda expressions do not support ref or out.
"A lambda expression cannot directly capture a ref or out parameter from an enclosing method. "
http://msdn.microsoft.com/en-us/library/bb397687.aspx
I can't even get an example like yours to work. Adding ref to the setup fails to compile.
You might want to check out the Moq discussions for more http://groups.google.com/group/moqdisc
Good luck.