3
테스트 용으로 작성한 봉인 된 특성이 있습니다. 그러나 테스트 클래스 내에서이 봉인 된 형질의 객체를 생성하는 것은 불가능합니다. 이 경우 어떻게 테스트 할 수 있습니까?스칼라에서 봉인 된 형질에 대한 테스트 만들기
Myclass.scala
sealed trait BaseTrait{
def myFunct = //an implemented function
}
case class SecondClass extends BaseTrait {
// This class I can test
// ...
}
MyclassTest.Scala
class MyclassTest extends WordSpec with MustMatchers{
//Here I want to write a test case for the function within the sealed trait
}
저는 Play Framework 2.3.6 및 스칼라가있는 프로젝트에서 작업하며 테스트를 위해 ScalaTestPlus를 사용하고 있습니다.