use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class ShouldAccept_create_Test method should_create_error_message_with_predicate_description.
@Test
public void should_create_error_message_with_predicate_description() {
ErrorMessageFactory factory = shouldAccept((String color) -> color.equals("green"), "Yoda", new PredicateDescription("green light saber"));
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %nExpecting:%n <'green light saber' predicate>%nto accept <\"Yoda\"> but it did not."));
}
use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class ShouldBeAfterOrEqualsTo_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(format("[Test] %n" + "Expecting:%n" + " <2011-01-01T00:00:00.000>%n" + "to be after or equals to:%n" + " <2012-01-01T00:00:00.000>"));
}
use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class ShouldBeAfter_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(format("[Test] %n" + "Expecting:%n" + " <2011-01-01T00:00:00.000>%n" + "to be strictly after:%n" + " <2012-01-01T00:00:00.000>"));
}
use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class ShouldBeAtIndex_create_Test method should_create_error_message.
@Test
public void should_create_error_message() {
ErrorMessageFactory factory = shouldBeAtIndex(newArrayList("Yoda", "Luke"), new TestCondition<String>("red lightsaber"), atIndex(1), "Luke");
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(String.format("[Test] %nExpecting:%n <\"Luke\">%nat index <1> to be:%n <red lightsaber>%nin:%n <[\"Yoda\", \"Luke\"]>%n"));
}
use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class ShouldBeBeforeOrEqualsTo_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(format("[Test] %n" + "Expecting:%n" + " <2011-01-01T00:00:00.000>%n" + "to be before or equals to:%n" + " <2012-01-01T00:00:00.000>"));
}
Aggregations