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
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
Would it be possible to add support for verifying arguments on non-public methods in the same manner as public methods?

To be more specific, I have an instance where I want to verify the arguments that are passed to a non-public method (which has been set to be ignored when called) called from the method that I am unit testing. The method being tested creates the variables that are passed to the non-public method, so I do not have any variables in my unit tests that I can use Isolate.Verify.NonPublic.WasCalled().WithArguments().

If the method was public, I could easily use Isolate.Verify.WasCalledWithArguments().Matching(). As of right now, though, my only option seems to be using DoInstead to get the parameters for the non-public method and then validate them.

Am I missing anything?

Brian
asked by bhunter (3.4k points)

3 Answers

0 votes
Brian,

You are not missing anything - we did not see demand for custom argument verification on non-public methods, and did not implement that feature. It is not generally recommended to test interaction with non public members to that level, as they are prone to change and the test would break. DoInstead() is the workable alternative until we implement this feature.

Right now this feature has a relatively low priority, but we can bump it up a little if it's a major hindrance. What are you trying to test? Do you see yourself using this sort of feature in a large number of tests?

Thanks,
Doron
Typemock Support
answered by doron (17.2k points)
0 votes
Bump.

My team would make consistent use of being able to use custom argument verification on non-public methods.

-thanks folks
answered by HoltMansfield (840 points)
0 votes
Bump.

My team would make consistent use of being able to use custom argument verification on non-public methods.

-thanks folks
answered by HoltMansfield (840 points)
...