I am new to java and I'm starting to learn the language. I'm trying to test a class using JUnit, but everytime I try I get an error "There are no open JUnit test cases..." Does anyone know what this error is and what do I need to do to resolve it?
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:
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.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.