Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion lib/src/mock.dart
Original file line number Diff line number Diff line change
Expand Up @@ -997,7 +997,10 @@ _InOrderVerification get verifyInOrder {
throw StateError(_verifyCalls.join());
}
_verificationInProgress = true;
return <T>(List<T> _) {
return <T>(List<T> responses) {
if (responses.length != _verifyCalls.length) {
fail('Used on a non-mockito object');
}
_verificationInProgress = false;
var verificationResults = <VerificationResult>[];
var time = DateTime.fromMillisecondsSinceEpoch(0);
Expand Down
12 changes: 12 additions & 0 deletions test/verify_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ void main() {
'2 verify calls have been stored.')));
}
});

test('should fail when called with non-mock-call parameter', () {
expectFail('Used on a non-mockito object', () {
verifyInOrder(['a string is not a mock call']);
});
});
});

group('verify should fail when no matching call is found', () {
Expand Down Expand Up @@ -457,6 +463,12 @@ void main() {
});
});

test('should fail when given non-mock-call parameters', () {
expectFail('Used on a non-mockito object', () {
verifyInOrder(['a string is not a mock call']);
});
});

test('verify been used as an argument fails', () {
mock.methodWithoutArgs();
mock.getter;
Expand Down