Search in sources :

Example 1 with IsIterableContainingInOrder

use of org.hamcrest.collection.IsIterableContainingInOrder in project cactoos by yegor256.

the class SortedTest method mustSortTextIterableAsSetUsingCustomCOmparator.

@Test
@SuppressWarnings("unchecked")
void mustSortTextIterableAsSetUsingCustomCOmparator() {
    new Assertion<>("Must keep unique integer numbers sorted in descending order", new Sorted<Text>((first, second) -> {
        final String left = new UncheckedText(first).asString();
        final String right = new UncheckedText(second).asString();
        return left.compareTo(right);
    }, new TextOf("cd"), new TextOf("ab"), new TextOf("gh"), new TextOf("ef")), new IsIterableContainingInOrder<Text>(new ListOf<>(new IsText("ab"), new IsText("cd"), new IsText("ef"), new IsText("gh")))).affirm();
}
Also used : IsIterableContainingInOrder(org.hamcrest.collection.IsIterableContainingInOrder) UncheckedText(org.cactoos.text.UncheckedText) IsText(org.llorllale.cactoos.matchers.IsText) TextOf(org.cactoos.text.TextOf) Test(org.junit.jupiter.api.Test)

Aggregations

TextOf (org.cactoos.text.TextOf)1 UncheckedText (org.cactoos.text.UncheckedText)1 IsIterableContainingInOrder (org.hamcrest.collection.IsIterableContainingInOrder)1 Test (org.junit.jupiter.api.Test)1 IsText (org.llorllale.cactoos.matchers.IsText)1