@Test public void test_resourceExists() { when(wiki.doesResourceExist(proj, "/bar.png")).thenReturn(false); assertFalse(wikiHtmlEmitter.doesResourceExist("/bar.png")); when(wiki.doesResourceExist(proj, "/foo.png")).thenReturn(true); assertTrue(wikiHtmlEmitter.doesResourceExist("/foo.png")); }
@Test public void test_getTitle_fragment() { DocTarget target = new DocTarget(); target.uri = "/yes2"; target.frag = "frag"; when(wiki.fileUri("/yes2.html")).thenReturn("/yes2.txt"); when(wiki.doesResourceExist(proj, "/yes2.txt")).thenReturn(true); when(wiki.getTitle(proj, "/yes2.html")).thenReturn("ok2"); assertEquals("ok2 » frag", wikiHtmlEmitter.getTitle(target)); assertEquals(0, wikiHtmlEmitter.getErrors().size()); }