/**** * * Junit test driver, discussed in CSC 309 Lecture Notes 7. * */ import java.util.Collection; import java.util.LinkedList; import junit.framework.TestCase; public class CoverageExampleTest extends TestCase { final CoverageExample ce = new CoverageExample(); public CoverageExampleTest(String nm) { super(nm); } /** * Test * Case Input Output Remarks * ===================================================== * 1 i=2, j=1 return = 9 Cover path 1 * 2 i=100, j=1 return = 204 Cover path 2 * 3 i=100, j=200 return = 202 Cover path 3 * 4 i=-2, j=-1 return = -2 Cover path 4 */ public void testF() {} /** * testF case */ public void testFCase1() { assertEquals(9, ce.f(-2,1)); } /** * testSquare Case 2. */ public void testFCase2() { assertEquals(204, ce.f(100,1)); } /** * testSquare Case 3. */ public void testFCase3() { assertEquals(202, ce.f(100,200)); } /** * testSquare Case 4. */ public void testFCase4() { assertEquals(-2, ce.f(-2,-1)); } }