Created
January 4, 2015 10:17
-
-
Save tomer-ben-david/25a515a5b9262bc766fe to your computer and use it in GitHub Desktop.
scalacheck generate a complex class
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case class MyCaseClass(e: SomeEnum, l: Long, d: SomeDouble) | |
def ratiosGen: Gen[MyCaseClass] = for { | |
e <- Gen.oneOf(Seq(State.ALWAYS, State.NONE, State.NEVER, null)) // one of the items. | |
l <- Arbitrary.arbitrary[Long] | |
d <- Arbitrary.arbitrary[Double] | |
} yield MyCaseClass(e, l, d) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment