Add filter for linked images
[Sone.git] / src / test / java / net / pterodactylus / sone / text / FreenetLinkPartTest.java
index 57284bf..1aff605 100644 (file)
@@ -35,8 +35,33 @@ public class FreenetLinkPartTest {
        }
 
        @Test
-       public void textIsUsedAsTitleIfNoTextIsGiven() {
-               assertThat(new FreenetLinkPart("link", "text", true).getTitle(), is("text"));
+       public void linkIsUsedAsTitleIfNoTextIsGiven() {
+               assertThat(new FreenetLinkPart("link", "text", true).getTitle(), is("link"));
+       }
+
+       @Test(expected = NullPointerException.class)
+       public void nullIsNotAllowedForLink() {
+               new FreenetLinkPart(null, "text", "title", true);
+       }
+
+       @Test(expected = NullPointerException.class)
+       public void nullIsNotAllowedForText() {
+               new FreenetLinkPart("link", null, "title", true);
+       }
+
+       @Test(expected = NullPointerException.class)
+       public void nullIsNotAllowedForLinkInSecondaryConstructor() {
+               new FreenetLinkPart(null, "text", true);
+       }
+
+       @Test(expected = NullPointerException.class)
+       public void nullIsNotAllowedForTextInSecondaryConstructor() {
+               new FreenetLinkPart("link", null, true);
+       }
+
+       @Test(expected = NullPointerException.class)
+       public void nullIsNotAllowedForTitle() {
+               new FreenetLinkPart("link", "text", null, true);
        }
 
 }