Yes, the method is call testsomething. Just like yo have it Christian. I'm taking this java class as a prerequisite to a graduate degree I'm working on. We are using Dr.Java to create classes and test them. Here's my test class:
package c1581.lab7 ;
import junit.framework.* ;
import java.awt.Color;
public class HitCheckerTester extends TestCase {
private Location recLoc;
private Rectangle rec;
private HitChecker checker;
private Location hit1;
private Location hit2;
public HitCheckerTester(String name){
super(name);
}
public void setUp(){
recLoc = new Location(100,100);
rec = new Rectangle( recLoc, 20, 10, Color.BLUE);
checker = new HitChecker();
hit1 = new Location( 105, 105);
hit2 = new Location(50,50);
checker = new HitChecker();
}
public void testHitPoints(){
}
public void testRectangleHit(){
assertTrue(checker.hit(rec,hit1));
}
}
I'm trying to test the testRectangleHit, but I get the error. All the other classes that this class interacts with have been given to us. This test works when it is run on the class lab machines, but won't work on my laptop. I must be missing something in the Java setup, but I can't figure out what it is.