RepeatingExpectation repeating = new RepeatingExpectation(1, 3);
repeating.addExpectation(expectation);
// Iterate over the events and target them at the repeating method.
for (Iterator iterator = events.iterator(); iterator.hasNext();) {
Event event = (Event) iterator.next();
repeating.checkExpectations(ExpectationState.CURRENT, event, report);
}
// Ensure that the expectations have been met.
repeating.verify();
// Now iterator over them again.
for (Iterator iterator = events.iterator(); iterator.hasNext();) {
Event event = (Event) iterator.next();
repeating.checkExpectations(ExpectationState.CURRENT, event, report);
}
// Ensure that the expectations have been met.
repeating.verify();
// Now iterator over them again.
for (Iterator iterator = events.iterator(); iterator.hasNext();) {
Event event = (Event) iterator.next();
repeating.checkExpectations(ExpectationState.CURRENT, event, report);
}
// Ensure that the expectations have been met.
repeating.verify();