Can we create multiple test methods in JUnit against single method? I have explored this in eclipse and I could not find any way. If we can than kindly tell me a way.
Can we create multiple test methods in JUnit against single method? I have explored
Share
Yes, JUnit can do this just fine. Write as many test methods as you need. Give each of them a name that describes what requirement it’s testing, and which case, and annotate each of them with
@Test.Check out my answer to testEquals(), testHashCode() and testToString() for an example of what test methods you might have in a simple case. Ignore the other answer 🙂