Thank you for bringing this question.
You can mock the PrivatelyDoWork() method as any other non-public member. You can try something like this:
The above will arrange the
method as follows: Whenever it is called with any string as an argument, it should do nothing. In the same time the method should occur exactly once during the test execution.
For this to work, I used InternalsVisibleTo atribute inside the AssemblyInfo of MyClass' assembly:
The above allows me to create a mock instance of MyClass: Mock.Create<MyClass>();
Please, check this
article of our online help documentation. In it you will find a lot of interesting examples about mocking non-public classes and members.
I hope this helps. Let me know if I can be of a further assistance.
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