So I'm suppose to create a JUnit test for 3 classes... each method should have its own test case... I've created the test classes, but I don't know how to code the actual tests. Here's one class that I have to create a test for, and the test class I created.
public class Sphere {
public double sphereVolume(double r){
double sphereVol = (4.0 / 3.0) * Math.PI * (Math.pow(r, 3));
return sphereVol;
}
public double sphereSurface(double r){
double sphereSurArea = 4.0 * Math.PI * (Math.pow(r, 2));
return sphereSurArea;
}
}
import junit.framework.TestCase;
public class SphereTest extends TestCase {
public void testSphereVolume() {
fail("Not yet implemented");
}
}
import junit.framework.TestCase;
public class SphereTest2 extends TestCase {
public void testSphereSurface() {
fail("Not yet implemented");
}
}