use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveComparableElementsAccordingToComparator_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] %nsome elements are not mutually comparable according to CaseInsensitiveStringComparator comparator in group:%n" + "<[\"b\", \"c\", \"a\"]>"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveToString_create_Test method should_create_error_message.
@Test
public void should_create_error_message() {
String actual = "c++";
String expectedToString = "java";
String errorMessage = shouldHaveToString(actual, expectedToString).create(new TestDescription("TEST"), new StandardRepresentation());
assertThat(errorMessage).isEqualTo(format("[TEST] %n" + "Expecting actual's toString() to return:%n" + " <\"java\">%n" + "but was:%n" + " <\"c++\">"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class BasicErrorMessageFactory_create_Test method should_create_error_with_configured_representation.
@Test
public void should_create_error_with_configured_representation() {
Description description = new TestDescription("Test");
String formattedMessage = "[Test] Hello Yoda";
when(formatter.format(eq(description), same(CONFIGURATION_PROVIDER.representation()), eq("Hello %s"), eq("Yoda"))).thenReturn(formattedMessage);
assertThat(factory.create(description)).isEqualTo(formattedMessage);
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ClassModifierShouldBe_create_Test method should_create_error_message_for_is_final.
@Test
public void should_create_error_message_for_is_final() {
String error = shouldBeFinal(Object.class).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting:%n" + " <java.lang.Object>%n" + "to be a \"final\" class but was \"public\"."));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ClassModifierShouldBe_create_Test method should_create_error_message_for_is_not_final.
@Test
public void should_create_error_message_for_is_not_final() {
String error = shouldNotBeFinal(String.class).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting:%n" + " <java.lang.String>%n" + "not to be a \"final\" class but was \"public final\"."));
}
Aggregations