use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class ShouldBeSymbolicLink_create_Test method should_create_error_message.
@Test
public void should_create_error_message() {
final Path actual = mock(Path.class);
String actualMessage = shouldBeSymbolicLink(actual).create(new TextDescription("Test"));
assertThat(actualMessage).isEqualTo(format("[Test] " + SHOULD_BE_SYMBOLIC_LINK, actual));
}
use of org.assertj.core.description.TextDescription 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.description.TextDescription 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.description.TextDescription 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."));
}
use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class ShouldBeEqualWithTimePrecision_create_Test method should_create_error_message_ignoring_minutes.
@Test
public void should_create_error_message_ignoring_minutes() {
ErrorMessageFactory factory = shouldBeEqual(parseDatetimeWithMs("2011-01-01T05:00:00.000"), parseDatetimeWithMs("2011-01-01T06:05:17.003"), TimeUnit.MINUTES);
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 and hour as:%n" + " <2011-01-01T06:05:17.003>%n" + "but had not."));
}
Aggregations