mirror of
https://github.com/alibaba/testable-mock.git
synced 2025-01-26 20:30:29 +08:00
allow to check method never invoke with parameters
This commit is contained in:
parent
ba2a823c19
commit
88fddf2bcc
@ -90,6 +90,24 @@ public class InvokeVerifier {
|
|||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Expect mock method had never invoked with specified parameters
|
||||||
|
* @param args parameters to compare
|
||||||
|
*/
|
||||||
|
public InvokeVerifier without(Object[] args) {
|
||||||
|
for (Object[] r : records) {
|
||||||
|
if (r.length == args.length) {
|
||||||
|
for (int i = 0; i < r.length; i++) {
|
||||||
|
if (!r[i].equals(args[i])) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
throw new VerifyFailedError("was invoked with " + desc(args));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Expect mock method have been invoked specified times
|
* Expect mock method have been invoked specified times
|
||||||
* @param expectedCount times to compare
|
* @param expectedCount times to compare
|
||||||
|
Loading…
Reference in New Issue
Block a user