factory_pal icon indicating copy to clipboard operation
factory_pal copied to clipboard

isRandom with range of values

Open nykolaslima opened this issue 10 years ago • 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

nykolaslima avatar May 28 '15 18:05 nykolaslima

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

SKoschnicke avatar Nov 15 '16 04:11 SKoschnicke