01: /*
02: * Created on 15.10.2004
03: *
04: * TODO To change the template for this generated file go to
05: * Window - Preferences - Java - Code Style - Code Templates
06: */
07: package org.jzonic.webtester;
08:
09: import org.jzonic.webtester.commands.*;
10:
11: import junit.framework.TestCase;
12:
13: /**
14: * @author Mecky
15: *
16: * TODO To change the template for this generated type comment go to
17: * Window - Preferences - Java - Code Style - Code Templates
18: */
19: public class CheckTextCommandTest extends TestCase {
20:
21: public void testOne() {
22: WebTestContext ctx = new WebTestContext();
23: ctx.setContent("Hello world!");
24: CheckTextCommand command = new CheckTextCommand();
25: command.setParameter("world");
26: WebTestNodeResult result = command.execute(ctx);
27: assertNotNull(result);
28: assertTrue(result.isSuccess());
29: }
30:
31: public void testTwo() {
32: WebTestContext ctx = new WebTestContext();
33: ctx.setContent("Hello world!");
34: CheckTextCommand command = new CheckTextCommand();
35: command.setParameter("not here");
36: WebTestNodeResult result = command.execute(ctx);
37: assertNotNull(result);
38: assertTrue(!result.isSuccess());
39: }
40: }
|