开发者

TestNG Eclipse plug-in : How to change the name prefix of methods for [New -> TestNG Class]?

开发者 https://www.devze.com 2023-03-27 20:38 出处:网络
Preferred @Test public void testMethodName() {} // [New -> JUnit Test Case] than @Test public void methodName() {} // [New -> TestNG Class]

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 :

  1. [New -> JUnit Test Case].
  2. Quick Assist : Conve开发者_运维百科rt to TestNG (Annotations)

Any easier way ?


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...

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号