use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldOnlyHaveElementsOfTypes_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(format("[Test] %n" + "Expecting:%n" + " <[\"Yoda\", 42, \"Luke\"]>%n" + "to only have instances of:%n" + " <[java.lang.Number, java.lang.Long]>%n" + "but these elements are not:%n" + " <[\"Yoda\" (java.lang.String), \"Luke\" (java.lang.String)]>"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldStartWithPath_create_Test method should_create_error_message.
@Test
public void should_create_error_message() {
final Path actual = mock(Path.class);
final Path other = mock(Path.class);
String actualMessage = shouldStartWith(actual, other).create(new TestDescription("Test"), new StandardRepresentation());
assertThat(actualMessage).isEqualTo(String.format("[Test] " + PATH_SHOULD_START_WITH, actual, other));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveAnchor_create_Test method should_create_error_message_for_has_anchor.
@Test
public void should_create_error_message_for_has_anchor() throws Exception {
URL uri = new URL("http://assertj.org/news#print");
String error = shouldHaveAnchor(uri, "foo").create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting anchor of%n" + " <http://assertj.org/news#print>%n" + "to be:%n" + " <\"foo\">%n" + "but was:%n" + " <\"print\">"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveAnchor_create_Test method should_create_error_message_for_has_no_anchor.
@Test
public void should_create_error_message_for_has_no_anchor() throws Exception {
URL uri = new URL("http://assertj.org/news#print");
String error = shouldHaveAnchor(uri, null).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting:%n" + " <http://assertj.org/news#print>%n" + "not to have an anchor but had:%n" + " <\"print\">"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveAuthority_create_Test method should_create_error_message_for_uri.
@Test
public void should_create_error_message_for_uri() throws Exception {
URI uri = new URI("http://assertj.org:8080/news");
String error = shouldHaveAuthority(uri, "foo.org").create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting authority of%n" + " <http://assertj.org:8080/news>%n" + "to be:%n" + " <\"foo.org\">%n" + "but was:%n" + " <\"assertj.org:8080\">"));
}
Aggregations