Mocking a private static method/function is completely achievable with JustMock. For more details and some examples, please check this
article for our online help documentation.
Further, I have prepared a simple demo for you:
Let's assume we have the following static class
Now, we want to check if the PrivateMethod
is being called from the CallPrivate
method. To do this, I prepared the following test
Mock.NonPublic.Assert(typeof(StaticClass), "PrivateMethod", ArgExpr.IsAny<object>());
I hope this helps.
Share what you think about JustTrace & JustMock with us, so we can become even better! You can use the built-in feedback tool inside JustTrace, our forums
, or our JustTrace