public class FreenetLinkPartTest {
@Test
+ public void freenetLinkPartIsNotAPlainTextPart() {
+ FreenetLinkPart freenetLinkPart = new FreenetLinkPart("link", "text", true);
+ assertThat(freenetLinkPart.isPlainText(), is(false));
+ }
+
+ @Test
+ public void freenetLinkPartIsAFreenetLink() {
+ FreenetLinkPart freenetLinkPart = new FreenetLinkPart("link", "text", true);
+ assertThat(freenetLinkPart.isFreenetLink(), is(true));
+ }
+
+ @Test
public void trustedAttributeIsStoredAndReturnedWhenSet() {
FreenetLinkPart freenetLinkPart = new FreenetLinkPart("link", "text", true);
assertThat(freenetLinkPart.isTrusted(), is(true));
public class LinkPartTest {
@Test
+ public void linkPartIsNotAPlainTextPart() {
+ LinkPart linkPart = new LinkPart("http://li.nk/link.html", "link.html");
+ assertThat(linkPart.isPlainText(), is(false));
+ }
+
+ @Test
+ public void linkPartIsNotAFreenetLink() {
+ LinkPart linkPart = new LinkPart("http://li.nk/link.html", "link.html");
+ assertThat(linkPart.isFreenetLink(), is(false));
+ }
+
+ @Test
public void linkPartWithoutTitleGetsTextAsTitle() {
LinkPart linkPart = new LinkPart("http://li.nk/link.html", "link.html");
assertThat(linkPart.getLink(), is("http://li.nk/link.html"));
}
@Test
+ public void partContainerIsNotAPlainTextPart() {
+ assertThat(partContainer.isPlainText(), is(false));
+ }
+
+ @Test
+ public void partContainerIsNotAFreenetLink() {
+ assertThat(partContainer.isFreenetLink(), is(false));
+ }
+
+ @Test
public void partContainerCanReturnContainedParts() {
assertThat(partContainer, contains(matchesPart("Test!"), matchesPart(" More Test!")));
}
private final PlainTextPart plainTextPart = new PlainTextPart("<plain-text>");
@Test
+ public void plainTextPartIsAPlainTextPart() {
+ assertThat(plainTextPart.isPlainText(), is(true));
+ }
+
+ @Test
+ public void plainTextPartIsNotAFreenetLink() {
+ assertThat(plainTextPart.isFreenetLink(), is(false));
+ }
+
+ @Test
public void plainTextPartCanStoreAndReturnText() {
assertThat(plainTextPart.getText(), is("<plain-text>"));
}
private final PostPart postPart = new PostPart(post);
@Test
+ public void postPartIsNotAPlainTextPart() {
+ assertThat(postPart.isPlainText(), is(false));
+ }
+
+ @Test
+ public void postPartIsNotAFreenetLink() {
+ assertThat(postPart.isFreenetLink(), is(false));
+ }
+
+ @Test
public void postPartCanStoreAndReturnPost() {
assertThat(postPart.getPost(), is(post));
}
private final SonePart sonePart = new SonePart(sone);
@Test
+ public void sonePartIsNotAPlainTextPart() {
+ assertThat(sonePart.isPlainText(), is(false));
+ }
+
+ @Test
+ public void sonePartIsNotAFreenetLink() {
+ assertThat(sonePart.isFreenetLink(), is(false));
+ }
+
+ @Test
public void sonePartCanStoreAndReturnSone() {
assertThat(sonePart.getSone(), is(sone));
}