Reputation: 65
I used JUnit 3 and when I wrote this code I got this error
AssertionFailedError : No test Found
import junit.framework.TestCase;
import junit.runner.*;
public class Teststd extends TestCase {
Student s;
public void setUp() {
s = new Student("ASJFA");
}
public void TestEmail() {
try {
s.setEmail("KUKU");
assertTrue(false);
} catch (EmailIsInvalid ex) {
assertTrue(true);
System.out.println("Exception caught. Email is invalid");
}
}
public void tearDown() {
}
}
Upvotes: 0
Views: 576
Reputation: 22840
Your test method should start with a lowercase t
. It should be public void testEmail()
. Then it will be picked up by JUnit.
Upvotes: 6