命名约定 JUnit 后缀或前缀 Test [已关闭]
2022-08-31 16:00:12
受测类 MyClass.java JUnit 测试用例名称替代项:
TestMyClass.java
MyClassTest.java
http://moreunit.sourceforge.net 似乎使用“Test”作为前缀默认值,但我看到了这两种用法。在 eclipse 中将整个项目作为单元测试运行时,两者似乎都可以识别,因为它是类内部的注释,用于@Test。我想maven也做同样的事情。
哪个是首选?