【发布时间】:2011-05-22 22:36:41
【问题描述】:
有没有办法用 Scala 实现 参数化单元测试?目前,我在其余程序中使用 JUnit4,并且我想继续仅使用“标准”API。
我找到了Junit4 with Groovy 的示例,但我在定义static 部分时遇到了问题。可能是,因为我对 Scala 也很陌生 :-)
我现在也这么快
导入 org.junit.Test 导入 org.junit.Assert._ 导入 org.junit.runner.RunWith 导入 org.junit.runners.Parameterized 导入 org.junit.runners.Parameterized.Parameters @RunWith(classOf[参数化]) 类 MyTest 扩展 junit.framework.TestCase { @Parameters 对象数据 { ... } @范围 ... @测试 def testFunction() = { }【问题讨论】:
标签: unit-testing scala junit junit4