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_uri_with_wrong_parameter_value.
@Test
public void should_create_error_message_for_uri_with_wrong_parameter_value() throws Exception {
URI uri = new URI("http://assertj.org/news?article=11");
String error = shouldHaveParameter(uri, "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_missing_url_parameter.
// URL
@Test
public void should_create_error_message_for_missing_url_parameter() throws Exception {
URL url = new URL("http://assertj.org/news");
String error = shouldHaveParameter(url, "article").create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting:%n" + " <http://assertj.org/news>%n" + "to have parameter:%n" + " <\"article\">%n" + "but was missing"));
}
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_values.
@Test
public void should_create_error_message_for_url_with_wrong_parameter_values() throws Exception {
URL url = new URL("http://assertj.org/news?article=11");
String error = shouldHaveParameter(url, "article", "10", newArrayList("11", "12")).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 values:%n" + " <\"[11, 12]\">"));
}
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_uri_no_parameter_value_but_found.
@Test
public void should_create_error_message_for_uri_no_parameter_value_but_found() throws Exception {
URI uri = new URI("http://assertj.org/news?article=10");
String error = shouldHaveNoParameter(uri, "article", "10", newArrayList("10")).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting:%n" + " <http://assertj.org/news?article=10>%n" + "not to have parameter:%n" + " <\"article\">%n" + "with value:%n" + " <\"10\">%n" + "but did"));
}
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_parameter_without_value_that_has_one.
@Test
public void should_create_error_message_for_url_parameter_without_value_that_has_one() throws Exception {
URL url = new URL("http://assertj.org/news?article=10");
String error = shouldHaveParameter(url, "article", null, newArrayList("10")).create(new TestDescription("TEST"));
assertThat(error).isEqualTo(format("[TEST] %n" + "Expecting:%n" + " <http://assertj.org/news?article=10>%n" + "to have parameter:%n" + " <\"article\">%n" + "with no value, but parameter had value:%n" + " <\"10\">"));
}
Aggregations