【发布时间】:2019-07-09 02:21:26
【问题描述】:
我正在尝试在 Scala 上运行以下单元测试。我收到错误未找到测试类:mainFolder.TestDictionary
这是我的目录的样子:
src
|_ mainFolder
| |_ Dictionary.scala
|_ testing
|_ TestDictionary.scala
这是我的TestDictionary.scala 单元测试代码
package testing
import org.scalatest._
import mainFolder.Dictionary
class TestDictionary extends FunSuite {
test("Use many test cases for many category"){
val test1 = "CAT"
val test2 = "BAT"
val test3 = "DIAMOND"
val test4 = "THOUSAND"
val test5 = ""
val test6 = "HALF"
val test7 = "PHOTOGRAPH"
val test8 = "STAFF"
assert(Dictionary.isSounds(test1, test2) == true)
assert(Dictionary.isSounds(test5, test7) == true)
assert(Dictionary.isSounds(test4, test5) == true)
assert(Dictionary.isSounds(test5, test8) == true)
assert(Dictionary.isSounds(test3, test2) == true)
assert(Dictionary.isSounds(test4, test1) == true)
assert(Dictionary.isSounds(test1, test8) == true)
assert(Dictionary.isSounds(test8, test3) == true)
assert(Dictionary.isSounds(test5, test6) == true)
assert(Dictionary.isSounds(test8, test2) == true)
}
}
【问题讨论】:
-
我正在使用 Intellij
标签: java scala unit-testing intellij-idea