chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
0 votes
I seen we can mock up dependent private method and properties but what if I want to test private method only.
asked by viralpatelv (600 points)

1 Answer

+1 vote

I am not sure what your scenario is; basically Isolator provides support for faking out and verifying non public calls using the NonPublic APIs:
Isolate.NonPublic.WhenCalled(fake, "PrivateMethod").WillReturn(3);
Isolate.Verify.NonPublic.WasCalled(fake, "PrivateMethod");

Using these APIs you can control behavior and assert interaction on non-public methods and properties.

Does this answer your question?
Typemock Support
answered by doron (17.2k points)