use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class ElementsShouldBeAtMost_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 elements:%n<[\"Yoda\", \"Luke\", \"Obiwan\"]>%n to be at most 2 times <a Jedi>"));
}
use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class ElementsShouldHaveAtLeast_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 elements:%n<[\"Yoda\", \"Solo\", \"Leia\"]>%n to have at least 2 times <Jedi power>"));
}
use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class ElementsShouldMatch_create_Test method should_create_error_message_with_one_non_matching_element.
@Test
public void should_create_error_message_with_one_non_matching_element() {
ErrorMessageFactory factory = elementsShouldMatch(newArrayList("Luke", "Yoda"), "Yoda", PredicateDescription.GIVEN);
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %n" + "Expecting all elements of:%n" + " <[\"Luke\", \"Yoda\"]>%n" + "to match given predicate but this element did not:%n" + " <\"Yoda\">"));
}
use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class ElementsShouldMatch_create_Test method should_create_error_message_with_multiple_non_matching_elements.
@Test
public void should_create_error_message_with_multiple_non_matching_elements() {
ErrorMessageFactory factory = elementsShouldMatch(newArrayList("Luke", "Yoda"), newArrayList("Luke", "Yoda"), PredicateDescription.GIVEN);
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %n" + "Expecting all elements of:%n" + " <[\"Luke\", \"Yoda\"]>%n" + "to match given predicate but these elements did not:%n" + " <[\"Luke\", \"Yoda\"]>"));
}
use of org.assertj.core.description.TextDescription in project assertj-core by joel-costigliola.
the class ElementsShouldNotBe_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 elements:%n<[\"Yoda\"]>%n of %n<[\"Darth Vader\", \"Leia\", \"Yoda\"]>%n not to be <not a Jedi>"));
}
Aggregations