X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FLinkPartTest.java;h=62648a1638fa3a8262f8016cc6c4077222bfbcaf;hb=4273a6ebdde8c4f1092a6c5d4f62ad483f3eaa96;hp=0059b09a5f5626ac28ec29740e3a04044ad9bad7;hpb=93b429b1e24f353d6be1b6ae5f77cee6f3a26b27;p=Sone.git diff --git a/src/test/java/net/pterodactylus/sone/text/LinkPartTest.java b/src/test/java/net/pterodactylus/sone/text/LinkPartTest.java index 0059b09..62648a1 100644 --- a/src/test/java/net/pterodactylus/sone/text/LinkPartTest.java +++ b/src/test/java/net/pterodactylus/sone/text/LinkPartTest.java @@ -30,8 +30,33 @@ public class LinkPartTest { } @Test - public void textIsUsedAsTitleIfNoTitleIsGiven() { - assertThat(new LinkPart("link", "text").getTitle(), is("text")); + public void linkIsUsedAsTitleIfNoTitleIsGiven() { + assertThat(new LinkPart("link", "text").getTitle(), is("link")); + } + + @Test(expected = NullPointerException.class) + public void nullIsNotAllowedForLink() { + new LinkPart(null, "text", "title"); + } + + @Test(expected = NullPointerException.class) + public void nullIsNotAllowedForText() { + new LinkPart("link", null, "title"); + } + + @Test(expected = NullPointerException.class) + public void nullIsNotAllowedForLinkInSecondaryConstructor() { + new LinkPart(null, "text"); + } + + @Test(expected = NullPointerException.class) + public void nullIsNotAllowedForTextInSecondaryConstructor() { + new LinkPart("link", null); + } + + @Test(expected = NullPointerException.class) + public void nullIsNotAllowedForTitle() { + new LinkPart("link", "text", null); } }