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
This is kind of reverse thinking...but hopefully you understand what I'm trying to verify.

I have a 'helper class' that has 4 public methods. Each of these methods are a variation of arguments that call a single private method.

What I'm trying to mock is that each of these 4 public methods only makes a single call to the expected method. Recording the call that is expected is the easy part...but how do I ensure no further calls to some other private method that may exist there in the future isn't called?

Make sense?
asked by boo (21.8k points)

1 Answer

0 votes
Hi Brian,

In a test you need to specify everything you want to happen and to test.
For instance, in the new API there's Verify.WasNotCalled, but you need to specify what exactly will not be called.

A shortcut you can take is to set the mock controller to Strict. But it works only on public methods.

I hope I answered your question, please let me know if you need further explanations.

Thanks
answered by gilz (14.5k points)
...