verify top-level property

_Verify verify

Verify that a method on a mock object was called with the given arguments.

Call a method on a mock object within the call to verify. For example:

cat.eatFood("chicken");
verify(() => cat.eatFood("fish"));

Mocktail will fail the current test case if cat.eatFood hasn't been called with "fish". Optionally, call called on the result, to verify that the method was called a certain number of times. For example:

verify(() => cat.eatFood("fish")).called(2);
verify(() => cat.eatFood("fish")).called(greaterThan(3));

Note: When mocktail verifies a method call, said call is then excluded from further verifications. A single method call cannot be verified from multiple calls to verify, or verifyInOrder. See more details in the FAQ.

Note: because of an unintended limitation, verify(...).called(0); will not work as expected. Please use verifyNever(...); instead.

See also: verifyNever, verifyInOrder, verifyZeroInteractions, and verifyNoMoreInteractions.

Implementation

_Verify get verify => _makeVerify(false);