use of org.llorllale.cactoos.matchers.HasValue in project cactoos by yegor256.
the class FlattenedTest method flattens.
@Test
void flattens() {
final Text txt = new TextOf("txt");
final Scalar<Text> sclr = new Constant<>(txt);
new Assertion<>("must flatten", new Flattened<>(new ScalarOf<>(() -> sclr)), new HasValue<>(new IsText(txt))).affirm();
}
use of org.llorllale.cactoos.matchers.HasValue in project cactoos by yegor256.
the class FirstOfTest method returnsMatchingValue.
@Test
void returnsMatchingValue() {
final int value = 1;
new Assertion<>("Must return the only matching element", new FirstOf<>(i -> i >= value, new IterableOfInts(0, value), () -> -1), new HasValue<>(value)).affirm();
}
use of org.llorllale.cactoos.matchers.HasValue in project cactoos by yegor256.
the class BinaryTest method conditionFalse.
@Test
public void conditionFalse() {
final int expected = 0;
final AtomicInteger counter = new AtomicInteger(0);
final Binary binary = new Binary(new False(), counter::incrementAndGet);
new Assertion<>("Binary has to return false", binary, new HasValue<>(false)).affirm();
new Assertion<>("Binary must not to invoke increment method", counter.get(), new IsEqual<>(expected)).affirm();
}
Aggregations