source: josm/trunk/test/unit/org/openstreetmap/josm/gui/help/HelpContentReaderTest.java@ 10103

Last change on this file since 10103 was 10103, checked in by Don-vip, 8 years ago

add more unit tests

  • Property svn:eol-style set to native
File size: 1.2 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.gui.help;
3
4import static org.junit.Assert.assertFalse;
5
6import org.junit.BeforeClass;
7import org.junit.Test;
8import org.openstreetmap.josm.JOSMFixture;
9
10/**
11 * Unit tests of {@link HelpContentReader} class.
12 */
13public class HelpContentReaderTest {
14
15 /**
16 * Setup tests
17 */
18 @BeforeClass
19 public static void setUpBeforeClass() {
20 JOSMFixture.createUnitTestFixture().init();
21 }
22
23 /**
24 * Unit test of {@link HelpContentReader#fetchHelpTopicContent} - null case.
25 * @throws HelpContentReaderException always
26 */
27 @Test(expected = HelpContentReaderException.class)
28 public void testFetchHelpTopicContentNull() throws HelpContentReaderException {
29 new HelpContentReader(null).fetchHelpTopicContent(null, false);
30 }
31
32 /**
33 * Unit test of {@link HelpContentReader#fetchHelpTopicContent} - nominal case.
34 * @throws HelpContentReaderException never
35 */
36 @Test
37 public void testFetchHelpTopicContentNominal() throws HelpContentReaderException {
38 String res = new HelpContentReader(HelpUtil.getWikiBaseUrl()).fetchHelpTopicContent(HelpBrowserTest.URL_1, false);
39 assertFalse(res.trim().isEmpty());
40 }
41}
Note: See TracBrowser for help on using the repository browser.