use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeEqualIgnoringGivenFields_create_Test method should_create_error_message_with_single_field_difference.
@Test
public void should_create_error_message_with_single_field_difference() {
factory = shouldBeEqualToIgnoringGivenFields(new Jedi("Yoda", "blue"), newArrayList("lightSaberColor"), newArrayList((Object) "blue"), newArrayList((Object) "green"), newArrayList("someIgnoredField"));
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(String.format("[Test] %n" + "Expecting value <\"green\"> in field <\"lightSaberColor\"> " + "but was <\"blue\"> in <Yoda the Jedi>.%n" + "Comparison was performed on all fields but <[\"someIgnoredField\"]>"));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeEqualIgnoringGivenFields_create_Test method should_create_error_message_with_all_fields_differences.
@Test
public void should_create_error_message_with_all_fields_differences() {
factory = shouldBeEqualToIgnoringGivenFields(new Jedi("Yoda", "blue"), newArrayList("name", "lightSaberColor"), newArrayList((Object) "Yoda", "blue"), newArrayList((Object) "Yoda", "green"), newArrayList("someIgnoredField"));
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(String.format("[Test] %n" + "Expecting values:%n" + " <[\"Yoda\", \"green\"]>%n" + "in fields:%n" + " <[\"name\", \"lightSaberColor\"]>%n" + "but were:%n" + " <[\"Yoda\", \"blue\"]>%n" + "in <Yoda the Jedi>.%n" + "Comparison was performed on all fields but <[\"someIgnoredField\"]>"));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeEqualIgnoringMinutes_create_Test method should_create_error_message_for_LocalTime.
@Test
public void should_create_error_message_for_LocalTime() {
factory = shouldBeEqualIgnoringMinutes(LocalTime.of(12, 0), LocalTime.of(12, 1));
String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + " <12:00>%n" + "to have same hour as:%n" + " <12:01>%n" + "but had not."));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeEqualIgnoringNanos_create_Test method should_create_error_message_for_LocalTime.
@Test
public void should_create_error_message_for_LocalTime() {
factory = shouldBeEqualIgnoringNanos(LocalTime.of(12, 0), LocalTime.of(13, 0));
String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + " <12:00>%n" + "to have same hour, minute and second as:%n" + " <13:00>%n" + "but had not."));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeInSameDay_create_Test method should_create_error_message.
@Test
public void should_create_error_message() {
ErrorMessageFactory factory = shouldBeInSameDay(parse("2010-01-01"), parse("2010-01-25"));
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + " <2010-01-01T00:00:00.000>%n" + "to be on same year, month and day as:%n" + " <2010-01-25T00:00:00.000>"));
}
Aggregations