florinn/typemoq

Allow single parameter verify calls

Opened this issue · 0 comments

Hej, thanks for this great mocking library!

This is a feature request regarding the second parameter of the IMock.verify method. I almost never really need it, i.e. I only use Times.atLeastOnce() most of the time. However having to write it out in each and every verification introduces boilerplate code and makes verifications seem more complex then they actually are.

serviceMock.verify(s => s.function(), Times.atLeastOnce());

As alternative I suggest to make the second parameter optional with a reasonable default value. Either Times.atLeastOnce() or Times.once() would work for a majority of cases and reduce the amount of the code required for the above verification by a third.

serviceMock.verify(s => s.function());

What do you think?