X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FLinkPartTest.java;h=431dfa61f4cc2aef548964ff13ca162e3c0ce4ca;hb=c5715384489bab302e209de0313aeb962d774c2e;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..431dfa6 100644 --- a/src/test/java/net/pterodactylus/sone/text/LinkPartTest.java +++ b/src/test/java/net/pterodactylus/sone/text/LinkPartTest.java @@ -34,4 +34,29 @@ public class LinkPartTest { assertThat(new LinkPart("link", "text").getTitle(), is("text")); } + @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); + } + }