@Test(expected = IllegalArgumentException.class) public void testSetNamespace2() throws Throwable { WikiLink wikiLink = new WikiLink("/wiki", "en", null); wikiLink.setNamespace(null); assertEquals( "wikiLink.getNamespace()", Namespace.namespace(Namespace.FILE_ID), wikiLink.getNamespace()); }
@Test public void testSetNamespace() throws Throwable { WikiLink wikiLink = new WikiLink("/wiki", "en", null); wikiLink.setNamespace(Namespace.namespace(Namespace.FILE_ID)); assertEquals( "wikiLink.getNamespace()", Namespace.namespace(Namespace.FILE_ID), wikiLink.getNamespace()); }
@Test public void testConstructor() throws Throwable { WikiLink wikiLink = new WikiLink("/wiki", "en", null); assertNull("wikiLink.getQuery()", wikiLink.getQuery()); assertNull("wikiLink.getSection()", wikiLink.getSection()); assertNull("wikiLink.getText()", wikiLink.getText()); assertNull("wikiLink.getArticle()", wikiLink.getArticle()); assertEquals( "wikiLink.getNamespace()", Namespace.namespace(Namespace.MAIN_ID), wikiLink.getNamespace()); assertNull("wikiLink.getDestination()", wikiLink.getDestination()); assertFalse("wikiLink.getColon()", wikiLink.getColon()); }
@Test public void testParseWikiLink() throws Throwable { WikiLink result = LinkUtil.parseWikiLink("en", "testLinkUtilRaw"); assertEquals("result.getArticle()", "testLinkUtilRaw", result.getArticle()); }
@Test public void testParseWikiLink1() throws Throwable { WikiLink result = LinkUtil.parseWikiLink(null, ""); assertNull("result.getArticle()", result.getArticle()); }
@Test public void testSetSection() throws Throwable { WikiLink wikiLink = new WikiLink("/wiki", "en", null); wikiLink.setSection("testWikiLinkSection"); assertEquals("wikiLink.getSection()", "testWikiLinkSection", wikiLink.getSection()); }
@Test public void testSetDestination() throws Throwable { WikiLink wikiLink = new WikiLink("/wiki", "en", "testWikiLinkDestination"); assertEquals("wikiLink.getDestination()", "testWikiLinkDestination", wikiLink.getDestination()); }
@Test public void testSetColon() throws Throwable { WikiLink wikiLink = new WikiLink("/wiki", "en", null); wikiLink.setColon(true); assertTrue("wikiLink.getColon()", wikiLink.getColon()); }
@Test public void testSetArticle() throws Throwable { WikiLink wikiLink = new WikiLink("/wiki", "en", null); wikiLink.setArticle("testWikiLinkArticle"); assertEquals("wikiLink.getArticle()", "testWikiLinkArticle", wikiLink.getArticle()); }