Reputation: 121
Preferred
@Test
public void testMethodName() {} // [New -> JUnit Test Case]
than
@Test
public void methodName() {} // [New -> TestNG Class]
I could achieve what I want by following steps :
[New -> JUnit Test Case]
.Quick Assist
: Convert to TestNG (Annotations)
Any easier way ?
Upvotes: 1
Views: 189
Reputation: 15608
This would be pretty easy to add but I'm not sure how useful it really is: ultimately, you will want to rename your method to describe what it actually does as a test. For example, a method called createAccount()
should probably be tested with a test method called accountShouldBeCreated()
.
Also, a single method usually ends up being tested by more than one test method: accountShouldBeCreated()
, alreadyExistingAccountShouldNotBeAllowed()
, etc...
Upvotes: 1