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_url.
@Test
public void should_create_error_message_for_url() throws Exception {
URL url = new URL("http://assertj.org:8080/news");
String error = shouldHaveAuthority(url, "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\">"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveFragment_create_Test method should_create_error_message_for_has_fragment.
@Test
public void should_create_error_message_for_has_fragment() throws Exception {
URI uri = new URI("http://assertj.org/news#print");
String error = shouldHaveFragment(uri, "foo").create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting fragment 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 ShouldHaveFragment_create_Test method should_create_error_message_for_has_no_fragment.
@Test
public void should_create_error_message_for_has_no_fragment() throws Exception {
URI uri = new URI("http://assertj.org/news#print");
String error = shouldHaveFragment(uri, null).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting URI:%n" + " <http://assertj.org/news#print>%n" + "not to have a fragment but had:%n" + " <\"print\">"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveParameter_create_Test method should_create_error_message_for_url_with_wrong_parameter_value.
@Test
public void should_create_error_message_for_url_with_wrong_parameter_value() throws Exception {
URL url = new URL("http://assertj.org/news?article=11");
String error = shouldHaveParameter(url, "article", "10", newArrayList("11")).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting:%n" + " <http://assertj.org/news?article=11>%n" + "to have parameter:%n" + " <\"article\">%n" + "with value:%n" + " <\"10\">%n" + "but had value:%n" + " <\"11\">"));
}
use of org.assertj.core.internal.TestDescription in project assertj-core by joel-costigliola.
the class ShouldHaveParameter_create_Test method should_create_error_message_for_url_with_no_parameter_that_has_one_without_value.
@Test
public void should_create_error_message_for_url_with_no_parameter_that_has_one_without_value() throws Exception {
URL url = new URL("http://assertj.org/news?article");
String error = shouldHaveNoParameter(url, "article", null, null).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting:%n" + " <http://assertj.org/news?article>%n" + "not to have parameter:%n" + " <\"article\">%n" + "with no value, but did"));
}
Aggregations