From: Barry K. <bk...@in...> - 2003-06-19 16:22:32
|
Often I find the need for a method to be called at least once, but its ok if its called more times. Generally this is with a getter that is providing a property used for some external purpose. What I end up doing is: myMock.expectAndReturn("getSomething", 12); myMock.matchAndReturn("getSomething", 12); While this works just fine, it gets to be a bit verbose at times. I know I can override the callable created by the 'expectAndReturn' method by creating the mock with a custom factory. But the that factory applies to all invocations of 'expect*'. What I would like is the ability to define custom callables on a per-method basis. I guess like the previous version allowed. Would it be so bad to have?: Mock.expectAndReturn(Callable callable) |