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
(sorry, forgot to click notify me when a reply is posted). I would love to help add code on this feature!!!!

Here are some examples in Java

Basically, there is no Init, there is not verify. Instead, there is just code like this

CalledMethod m = mockObj.expectCall("method");

assertTrue("values should be same", true, m.getParameters()[0]);
assertTrue("values should be same", 5, m.getParameters()[1]);

The expectCall blocks for a period of "timeout" which is configured by the user. The default is 10 seconds and I have never overridden it myself. Realize the return values can't be specified in the expectCall as the method may be called before or after my call to expectCall, so instead there are methods to add return values and add throwing exceptions. It is quite nice not needing a verify or init. This allows one to get rid of it.

asked by deanhiller (1.3k points)

1 Answer

0 votes
This has been answered in the original topic
answered by richard (3.9k points)