TestNG Eclipse 插件:如何更改 [New -> > 方法的名称前缀TestNG 类]?
首选
@Test
public void testMethodName() {} // [New -> JUnit Test Case]
比
@Test
public void methodName() {} // [New -> TestNG Class]
我可以通过以下步骤实现我想要的:
[New -> JUnit 测试用例]
。快速协助
:转换为TestNG(注释)
有更简单的方法吗?
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 ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这很容易添加,但我不确定它到底有多有用:最终,您将需要重命名您的方法以描述它作为测试实际执行的操作。例如,名为
createAccount()
的方法可能应该使用名为accountShouldBeCreated()
的测试方法进行测试。此外,单个方法通常最终会被多个测试方法测试:
accountShouldBeCreated()
、alreadyExistingAccountShouldNotBeAllowed()
等...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 calledaccountShouldBeCreated()
.Also, a single method usually ends up being tested by more than one test method:
accountShouldBeCreated()
,alreadyExistingAccountShouldNotBeAllowed()
, etc...