File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -997,7 +997,10 @@ _InOrderVerification get verifyInOrder {
997997 throw StateError (_verifyCalls.join ());
998998 }
999999 _verificationInProgress = true ;
1000- return < T > (List <T > _) {
1000+ return < T > (List <T > responses) {
1001+ if (responses.length != _verifyCalls.length) {
1002+ fail ('Used on a non-mockito object' );
1003+ }
10011004 _verificationInProgress = false ;
10021005 var verificationResults = < VerificationResult > [];
10031006 var time = DateTime .fromMillisecondsSinceEpoch (0 );
Original file line number Diff line number Diff line change @@ -206,6 +206,12 @@ void main() {
206206 '2 verify calls have been stored.' )));
207207 }
208208 });
209+
210+ test ('should fail when called with non-mock-call parameter' , () {
211+ expectFail ('Used on a non-mockito object' , () {
212+ verifyInOrder (['a string is not a mock call' ]);
213+ });
214+ });
209215 });
210216
211217 group ('verify should fail when no matching call is found' , () {
@@ -457,6 +463,12 @@ void main() {
457463 });
458464 });
459465
466+ test ('should fail when given non-mock-call parameters' , () {
467+ expectFail ('Used on a non-mockito object' , () {
468+ verifyInOrder (['a string is not a mock call' ]);
469+ });
470+ });
471+
460472 test ('verify been used as an argument fails' , () {
461473 mock.methodWithoutArgs ();
462474 mock.getter;
You can’t perform that action at this time.
0 commit comments