import junit.framework.TestCase; /* * Created on Jul 18, 2005 * * TODO To change the template for this generated file go to * Window - Preferences - Java - Code Style - Code Templates */ /** * @author alan * * TODO To change the template for this generated type comment go to * Window - Preferences - Java - Code Style - Code Templates */ public class SomeClassTest extends TestCase { public void testSumTwoThreeNums() { twonums[0] = 1; twonums[1] = 15; assertEquals("sum two test", 16, scla.sum(twonums)); threenums[0] = 3; threenums[1] = 3; threenums[2] = 3; assertEquals("sum three test", 9, scla.sum(threenums)); } private SomeClass scla; private int[] twonums; private int[] threenums; /* (non-Javadoc) * @see junit.framework.TestCase#setUp() */ protected void setUp() throws Exception { // TODO Auto-generated method stub super.setUp(); scla = new SomeClass(); twonums = new int[2]; threenums = new int[3]; } /* (non-Javadoc) * @see junit.framework.TestCase#tearDown() */ protected void tearDown() throws Exception { // TODO Auto-generated method stub super.tearDown(); } }