Say I have a method A.Do(Arg arg) which assigns some properties of arg (class Arg), let’s say it sets arg.Prop1 = "done". And I’m testing a void method B.Do(void):
public class B
{
public void Do()
{
var arg = InitArg();
A.Do(arg)
...
}
}
and I’ve mocked class A as new Mock< A>() with CodeBase=true. So how do I verify that arg.Prop1 == "done"?
With the example as given, you can’t.
argis private to the method B.Do(), so it’s not visible to the outside world, so you can’t verify any of its properties.