use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeSubsetOf_create_Test method should_create_error_message.
@Test
public void should_create_error_message() {
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(String.format("[Test] %nExpecting :%n <[\"Yoda\", \"Luke\"]>%nto be subset of%n <[\"Han\", \"Luke\"]>%nbut found these extra elements:%n <[\"Yoda\"]>"));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeSubsetOf_create_Test method should_create_error_message_with_custom_comparison_strategy.
@Test
public void should_create_error_message_with_custom_comparison_strategy() {
ErrorMessageFactory factory = shouldBeSubsetOf(newArrayList("Yoda", "Luke"), newArrayList("Han", "Luke"), newArrayList("Yoda"), new ComparatorBasedComparisonStrategy(CaseInsensitiveStringComparator.instance));
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(String.format("[Test] %nExpecting when comparing values using CaseInsensitiveStringComparator:%n <[\"Yoda\", \"Luke\"]>%nto be subset of%n <[\"Han\", \"Luke\"]>%nbut found these extra elements:%n <[\"Yoda\"]>"));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBe_create_Test method should_create_error_message.
@Test
public void should_create_error_message() {
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(String.format("[Test] %nExpecting:%n <\"Yoda\">%nto be <green>"));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeEqualIgnoringNewlineDifference_create_Test method should_create_error_message.
@Test
public void should_create_error_message() {
String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + " <\"foo\">%n" + "to be equal to:%n" + " <\"bar\">%n" + "ignoring newline differences ('\\r\\n' == '\\n')"));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeEqualIgnoringSeconds_create_Test method should_create_error_message_for_OffsetTime.
@Test
public void should_create_error_message_for_OffsetTime() {
factory = shouldBeEqualIgnoringSeconds(OffsetTime.of(12, 0, 1, 0, ZoneOffset.UTC), OffsetTime.of(12, 0, 2, 0, ZoneOffset.UTC));
String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + " <12:00:01Z>%n" + "to have same hour and minute as:%n" + " <12:00:02Z>%n" + "but had not."));
}
Aggregations