X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FLinkPartTest.java;h=431dfa61f4cc2aef548964ff13ca162e3c0ce4ca;hp=0059b09a5f5626ac28ec29740e3a04044ad9bad7;hb=7b55e0be6a3283e43a9bbab98f82aebdd948eb33;hpb=93b429b1e24f353d6be1b6ae5f77cee6f3a26b27 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); + } + }