문제

In a ScalaCheck + Specs2 based test, I need two dates whose distance (in days) it's at maximum of Int.MAX_VALUE.

I am using at the moment ScalaCheck provided arbitraries to generating two dates: since the date generator is backed by the Long generator, this leads to too many discarded cases, making my test to fail.

What is the right approach to solve the problem:

  • Shall I modify my generators or

  • Shall I modify the test parameters?

도움이 되었습니까?

해결책

The best approach is probably to create your own generators for your domain.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top