I'm attempting to mock a private method that has an argument passed by ref. The Mock.NonPublic.Arrange() is throing an ArgumentException with the message "Could not resolve the target method; make sure that you have provided arguments correctly."
Regardless of how I set up the arguments in the test, it can't seem to match the function. Is there a workaround? Here's a sample method signature:
The test calls Mock.NonPublic.Arrange() as follows:
Instead of IsNull<object>(), I tried IsAny<object>(), I tried passing in a variable of type object, and I tried passing in typeof(object).
In the interim, is there some kind of a workaround?
Regardless of how I set up the arguments in the test, it can't seem to match the function. Is there a workaround? Here's a sample method signature:
private
void
PrivateMethodWith1ArgByRef(
ref
object
arg)
The test calls Mock.NonPublic.Arrange() as follows:
Mock.NonPublic.Arrange(class1,
"PrivateMethodWith1ArgByRef"
, ArgExpr.IsNull<
object
>()).DoNothing();
Instead of IsNull<object>(), I tried IsAny<object>(), I tried passing in a variable of type object, and I tried passing in typeof(object).
In the interim, is there some kind of a workaround?