mardi 5 juin 2018

Random instance of ADT with "Random Data Generator"

This is a follow-up to my previous question:

Suppose I've got an ADT like this:

sealed trait A
case class A1(s: String)
case class A2(s: String)

I am using random data generator to create an instance of A:

import com.danielasfregola.randomdatagenerator.RandomDataGenerator._

val a = random[A]

Does it create uniformly either A1 or A2 instances ?




Aucun commentaire:

Enregistrer un commentaire