phockito icon indicating copy to clipboard operation
phockito copied to clipboard

Support basic verification modes

Open rowanhill opened this issue 10 years ago • 2 comments

I've added some basic verification mode functionality, to allow matching exact, max and min number of calls.

I haven't implemented only() or noMoreInteractions(), as they require a bit more effort (and, I suspect, aren't as frequently used). I also haven't done calls(), since that's to do with ordered verification, which I haven't tackled here either.

I think it's all fairly straightforward, but let me know if you have any questions or if there's anything you'd like me to change.

Thanks, Rowan

rowanhill avatar Apr 23 '14 21:04 rowanhill

I've got a bit more stuck into it and implemented noMoreInteractions, too. I'll probably look at implementing only() too when I get some more free time.

Note that the changes in the noMoreInteractions are a fair bit larger, but much of it is just refactoring, and pulling behaviour into typed objects, so it's not as big as it first looks!

Thanks, Rowan

rowanhill avatar Apr 26 '14 14:04 rowanhill

Okay, I've added only(). I've also modified the noMoreInteractions() commit slightly, and added some tests around verification failure messages

rowanhill avatar Apr 27 '14 12:04 rowanhill