Search in sources :

Example 1 with CaseInsensitiveStringComparator

use of org.assertj.core.util.CaseInsensitiveStringComparator in project assertj-core by joel-costigliola.

the class ShouldBeSortedAccordingToComparator_create_Test method should_create_error_message_with_comparator.

@Test
public void should_create_error_message_with_comparator() {
    ErrorMessageFactory factory = shouldBeSortedAccordingToGivenComparator(1, array("b", "c", "A"), new CaseInsensitiveStringComparator());
    String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
    assertThat(message).isEqualTo(format("[Test] %ngroup is not sorted according to CaseInsensitiveStringComparator comparator because element 1:%n <\"c\">%nis not less or equal than element 2:%n <\"A\">%ngroup was:%n <[\"b\", \"c\", \"A\"]>"));
}
Also used : CaseInsensitiveStringComparator(org.assertj.core.util.CaseInsensitiveStringComparator) TestDescription(org.assertj.core.internal.TestDescription) StandardRepresentation(org.assertj.core.presentation.StandardRepresentation) Test(org.junit.Test)

Aggregations

TestDescription (org.assertj.core.internal.TestDescription)1 StandardRepresentation (org.assertj.core.presentation.StandardRepresentation)1 CaseInsensitiveStringComparator (org.assertj.core.util.CaseInsensitiveStringComparator)1 Test (org.junit.Test)1