标签: testing junit
有一种聪明的方法可以为测试单个方法的JUnit测试提供测试数据列表。例如。我有以下测试数据:
HashMap<InputParameterType,ExpectedResultType> testdata; foreach (e : testdata) { assertEquals(methodUnderTest(e.getKey()),e.getValue()) }
这是以某种方式提供的,但我不记得google的任何关键字。请帮忙; - )
答案 0 :(得分:1)
您可能正在寻找参数化注释 http://kentbeck.github.com/junit/javadoc/latest/
http://isagoksu.com/2009/development/agile-development/test-driven-development/using-junit-parameterized-annotation/