X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FFreenetLinkPartTest.java;fp=src%2Ftest%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Ftext%2FFreenetLinkPartTest.java;h=0000000000000000000000000000000000000000;hb=de6d73a2f0718ff65832859a3ef7ba4f32299327;hp=1aff605e7d401cf66b234a586ea3e916acd643bb;hpb=4273a6ebdde8c4f1092a6c5d4f62ad483f3eaa96;p=Sone.git diff --git a/src/test/java/net/pterodactylus/sone/text/FreenetLinkPartTest.java b/src/test/java/net/pterodactylus/sone/text/FreenetLinkPartTest.java deleted file mode 100644 index 1aff605..0000000 --- a/src/test/java/net/pterodactylus/sone/text/FreenetLinkPartTest.java +++ /dev/null @@ -1,67 +0,0 @@ -package net.pterodactylus.sone.text; - -import static org.hamcrest.MatcherAssert.assertThat; -import static org.hamcrest.Matchers.is; - -import org.junit.Test; - -/** - * Unit test for {@link FreenetLinkPart}. - * - * @author David ‘Bombe’ Roden - */ -public class FreenetLinkPartTest { - - private final FreenetLinkPart part = new FreenetLinkPart("link", "text", "title", true); - - @Test - public void linkIsRetainedCorrectly() { - assertThat(part.getLink(), is("link")); - } - - @Test - public void textIsRetainedCorrectly() { - assertThat(part.getText(), is("text")); - } - - @Test - public void titleIsRetainedCorrectly() { - assertThat(part.getTitle(), is("title")); - } - - @Test - public void trustedIsRetainedCorrectly() { - assertThat(part.isTrusted(), is(true)); - } - - @Test - 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); - } - -}