Requested featurecall.Optional(), so that a expected function has not to be called.
Why the feature is needed
Currently, it is not possible to write universal mocks for all my tests since aborting test due to missing call(s) is thrown. Usually this would not be necessary or even advisable, however, in this particular case it would work just fine and reduces code duplication manifold.
In the following (slimed down) example I create a mock DAO object, which I want to re-use in all different kind of tests. Unfortunately, I can't use it for all tests, since not all Calls are expected.
Requested feature
call.Optional()
, so that a expected function has not to be called.Why the feature is needed Currently, it is not possible to write universal mocks for all my tests since
aborting test due to missing call(s)
is thrown. Usually this would not be necessary or even advisable, however, in this particular case it would work just fine and reduces code duplication manifold.In the following (slimed down) example I create a mock DAO object, which I want to re-use in all different kind of tests. Unfortunately, I can't use it for all tests, since not all Calls are expected.
What I've tried is setting
minTimes
to zero, but that unfortunately also doesn't work.If there is already a way to circumvent this problem let me know, thanks ❤️ .