mgonto/factory_pal

isRandom with range of values

Opened this issue · 1 comments

Is it possible to call isRandom but specifying the possible values?

Something like:

FactoryPal.register[Person]() { person =>
    person.age.isRandom(18, 19, 20)
}

@mgonto

Not directly, I think. But you can pass your own generator function which is called without parameters and has to provide the value. See https://github.com/mgonto/factory_pal/blob/master/framework-src/src/main/scala/ar/com/gonto/factorypal/fields/FieldBuilder.scala#L45