use of org.llorllale.cactoos.matchers.Assertion in project cactoos by yegor256.
the class IoCheckedProcTest method rethrowsIoException.
@Test
void rethrowsIoException() {
final IOException exception = new IOException("intended");
new Assertion<>("Must rethrow original IOException", () -> {
new IoCheckedProc<>((Proc<Integer>) i -> {
throw exception;
}).exec(1);
return null;
}, new Throws<>(exception.getMessage(), exception.getClass())).affirm();
}
use of org.llorllale.cactoos.matchers.Assertion in project cactoos by yegor256.
the class RepeatedProcTest method runsProcMultipleTimes.
@Test
void runsProcMultipleTimes() throws Exception {
final AtomicInteger atom = new AtomicInteger();
final Proc<AtomicInteger> func = new RepeatedProc<>(AtomicInteger::getAndIncrement, 3);
func.exec(atom);
new Assertion<>("must run proc 3 times", atom.get(), new IsEqual<>(3));
}
Aggregations