Source Code : JUnit Extends TestCase
Java Is Open Source Programming Language You Can Download From Java and Java Libraries From http://www.oracle.com.
Click Here to download
We provide this code related to title for you to solve your developing problem easily. Libraries which is import in this program you can download from http://www.oracle.com.
Click Here or search from google with Libraries Name you get jar file related it
JUnit Extends TestCase
import java.util.ArrayList;
import java.util.List;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import junit.framework.Test;
import junit.framework.TestCase;
import junit.framework.TestSuite;
public class MainClass extends TestCase{
public static void main (String[] args) {
junit.textui.TestRunner.run (suite());
}
public static junit.framework.Test suite() {
return new TestSuite(MainClass.class);
}
public void testAdd() {
assertTrue(6 == 6);
}
public void testDivideByZero() {
int zero= 0;
int result= 8/zero;
}
public void testEquals() {
assertEquals(12, 12);
}
}
Thank with us