使用Java JUnit框架里的@Rule注解的用法举例

  1. 云栖社区>
  2. 汪子熙>
  3. 博客>
  4. 正文

使用Java JUnit框架里的@Rule注解的用法举例

jerrywangsap 2020-05-07 20:55:56 浏览390
展开阅读全文

Suppose you need to repeatedly execute some test method in your unit test case, for example, you would like to test getPrice based on the first set of test data 5 times in test method test1() while for the second set of test data, only one time should be executed.

The below class RepeatDemoOne is a bad example, where this special LOOP operation is mixed with test metho

网友评论

登录后评论
0/500
评论
jerrywangsap
+ 关注
所属团队号: 汪子熙