There is a fail()
method in JUnit4 library. I like it, but experiencing a lack of pass()
method which is not present in the library. Why is it so?
I've found out that I can use assertTrue(true)
instead but still looks unlogical.
@Test
public void testSetterForeignWord(){
try {
card.setForeignWord("");
fail();
} catch (IncorrectArgumentForSetter ex){
}
// assertTrue(true);
}
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…