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_LocalTime.
@Test
public void should_create_error_message_for_LocalTime() {
factory = shouldBeEqualIgnoringSeconds(LocalTime.of(12, 0, 1), LocalTime.of(12, 0, 2));
String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + " <12:00:01>%n" + "to have same hour and minute as:%n" + " <12:00:02>%n" + "but had not."));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeEqualIgnoringTimezone_create_Test method should_create_error_message_for_OffsetTime.
@Test
public void should_create_error_message_for_OffsetTime() {
factory = shouldBeEqualIgnoringTimezone(OffsetTime.of(12, 0, 0, 0, UTC), OffsetTime.of(12, 0, 0, 0, MIN));
String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + " <12:00Z>%n" + "to have same time fields except timezone as:%n" + " <12:00-18:00>%n" + "but had not."));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeEqualIgnoringTimezone_create_Test method should_create_error_message_for_OffsetDateTime.
@Test
public void should_create_error_message_for_OffsetDateTime() {
factory = shouldBeEqualIgnoringTimezone(OffsetDateTime.of(2000, 5, 13, 12, 0, 0, 0, UTC), OffsetDateTime.of(2000, 5, 13, 12, 0, 0, 0, MIN));
String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %n" + "Expecting:%n" + " <2000-05-13T12:00Z>%n" + "to have same time fields except timezone as:%n" + " <2000-05-13T12:00-18:00>%n" + "but had not."));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeEqualWithTimePrecision_create_Test method should_create_error_message_ignoring_milliseconds.
@Test
public void should_create_error_message_ignoring_milliseconds() {
ErrorMessageFactory factory = shouldBeEqual(parseDatetimeWithMs("2011-01-01T05:00:00.000"), parseDatetimeWithMs("2011-01-01T06:05:17.003"), TimeUnit.MILLISECONDS);
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %nExpecting:%n" + " <2011-01-01T05:00:00.000>%n" + "to have same year, month, day, hour, minute and second as:%n" + " <2011-01-01T06:05:17.003>%n" + "but had not."));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldBeEqualWithTimePrecision_create_Test method should_create_error_message_ignoring_seconds.
@Test
public void should_create_error_message_ignoring_seconds() {
ErrorMessageFactory factory = shouldBeEqual(parseDatetimeWithMs("2011-01-01T05:00:00.000"), parseDatetimeWithMs("2011-01-01T06:05:17.003"), TimeUnit.SECONDS);
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %nExpecting:%n" + " <2011-01-01T05:00:00.000>%n" + "to have same year, month, day, hour and minute as:%n" + " <2011-01-01T06:05:17.003>%n" + "but had not."));
}
Aggregations