Open
Description
I initially thought that verify(something).called(0)
would be equivalent to verifyNever
. Instead the first fails with a no matching calls
error. I am not sure if this is a bug or not, but if called
doesn't support values <= 0 then it should throw a better error, perhaps pointing a user to verifyNever
.
Minimal example:
import 'package:test/test.dart';
import 'package:mockito/mockito.dart';
void main() {
group('verify calls', () {
test('verifyNever passes', () {
var cat = new MockCat();
verifyNever(cat.countLives());
});
test('verify .called(0) fails', () {
var cat = new MockCat();
verify(cat.countLives()).called(0);
});
});
}
class Cat {
int countLives() => 9;
}
class MockCat extends Mock implements Cat {}