called method
void
called(
- dynamic matcher
Assert that the number of calls matches matcher
.
Examples:
verify(mock.m()).called(1)
asserts thatm()
is called exactly once.verify(mock.m()).called(greaterThan(2))
asserts thatm()
is called more than two times.
To assert that a method was called zero times, use verifyNever.
Implementation
void called(dynamic matcher) {
expect(
callCount,
wrapMatcher(matcher),
reason: 'Unexpected number of calls',
);
}