Wanted to find out if mocking a private method with ref/out params is now possible with JM?
answered on 07 May 2015, 11:33 AM
Yes, it is possible and has been for quite some time now, using the Mock.NonPublic API.
Say you have a ref/out argument of type int. You can use ArgExpr.Ref(ArgExpr.IsAny<int>()) if you want to match the incoming value, or ArgExpr.Out(123), if you want calls to the arranged method to set the ref/out parameter to 123 on exit.