01: // Copyright (C) 2003,2004,2005 by Object Mentor, Inc. All rights reserved.
02: // Released under the terms of the GNU General Public License version 2 or later.
03: package fitnesse.wikitext.widgets;
04:
05: import fitnesse.testutil.AbstractRegex;
06: import junit.swingui.TestRunner;
07:
08: public class ItalicWidgetTest extends AbstractRegex {
09: public static void main(String[] args) {
10: TestRunner
11: .main(new String[] { "fitnesse.wikitext.widgets.ItalicWidgetTest" });
12: }
13:
14: public void setUp() throws Exception {
15: }
16:
17: public void tearDown() throws Exception {
18: }
19:
20: public void testRegexp() throws Exception {
21: assertMatches(ItalicWidget.REGEXP, "''italic''");
22: assertMatches(ItalicWidget.REGEXP, "'' 'italic' ''");
23: }
24:
25: public void testItalicWidgetRendersHtmlItalics() throws Exception {
26: ItalicWidget widget = new ItalicWidget(new MockWidgetRoot(),
27: "''italic text''");
28: assertEquals("<i>italic text</i>", widget.render());
29: }
30: }
|