01: /*
02: * TestClassTest.java
03: * JUnit based test
04: *
05: * Created on September 12, 2006, 12:05 PM
06: */
07:
08: package org.netbeans.test.junit.testresults.test;
09:
10: import junit.framework.*;
11:
12: /**
13: *
14: * @author ms159439
15: */
16: public class TestClassTest extends TestCase {
17:
18: public TestClassTest(String testName) {
19: super (testName);
20: }
21:
22: protected void setUp() throws Exception {
23: }
24:
25: protected void tearDown() throws Exception {
26: }
27:
28: public static Test suite() {
29: junit.framework.TestSuite suite = new junit.framework.TestSuite(
30: TestClassTest.class);
31: return suite;
32: }
33:
34: /**
35: * Test of add0 method, of class org.netbeans.test.junit.testresults.test.TestClass.
36: */
37: public void testAdd0() {
38: System.out.println("add0");
39:
40: int a = 1;
41: int b = 1;
42: TestClass instance = new TestClass();
43:
44: int expResult = 2;
45: int result = instance.add0(a, b);
46: assertEquals(expResult, result);
47: }
48:
49: /**
50: * Test of add1 method, of class org.netbeans.test.junit.testresults.test.TestClass.
51: */
52: public void testAdd1() {
53: System.out.println("add1");
54:
55: int a = 1;
56: int b = 1;
57: TestClass instance = new TestClass();
58:
59: int expResult = 0; //wrong -- should fail
60: int result = instance.add1(a, b);
61: assertEquals(expResult, result);
62: }
63:
64: }
|