use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldNotHaveSameClass_create_Test method should_create_error_message.
@Test
public void should_create_error_message() {
String message = factory.create(new TestDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(String.format("[Test] %nExpecting:%n <\"Yoda\">%nnot to have not the same class as:%n <\"Luke\"> (java.lang.String)"));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldNotHave_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\">%nnot to have:%n <red lightsaber>"));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldNotMatchPattern_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\"%nnot to match pattern:%n \"Luke\""));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldNotMatch_create_Test method should_create_error_message_with_predicate_description.
@Test
public void should_create_error_message_with_predicate_description() {
ErrorMessageFactory factory = shouldNotMatch("Yoda", (String color) -> color.equals("green"), new PredicateDescription("green light saber"));
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(format("[Test] %nExpecting:%n <\"Yoda\">%nnot to match 'green light saber' predicate."));
}
use of org.assertj.core.presentation.StandardRepresentation in project assertj-core by joel-costigliola.
the class ShouldNotStartWith_create_Test method should_create_error_message_with_custom_comparison_strategy.
@Test
public void should_create_error_message_with_custom_comparison_strategy() {
factory = shouldNotStartWith(newArrayList("Yoda", "Luke"), newArrayList("Han", "Leia"), new ComparatorBasedComparisonStrategy(CaseInsensitiveStringComparator.instance));
String message = factory.create(new TextDescription("Test"), new StandardRepresentation());
assertThat(message).isEqualTo(String.format("[Test] %n" + "Expecting:%n" + " <[\"Yoda\", \"Luke\"]>%n" + "not to start with:%n" + " <[\"Han\", \"Leia\"]>%n" + "when comparing values using CaseInsensitiveStringComparator"));
}
Aggregations