How to create unit tests easily in eclipse

Chotka picture Chotka · Feb 27, 2011 · Viewed 142.1k times · Source

I want to create unit tests easily by just selecting method. Is there a tool in eclipse that does that. It should support templates. I should be able to create positive test as well as negative tests.

Answer

卢声远 Shengyuan Lu picture 卢声远 Shengyuan Lu · Feb 28, 2011

To create a test case template:

"New" -> "JUnit Test Case" -> Select "Class under test" -> Select "Available methods". I think the wizard is quite easy for you.