You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
How to properly delegate a generator configuration?
Assume MyObject has two attributes of the same type whose generators need to be configured. Let's say foo and bar are both integers, and I want to configure them with different ranges. I created a configuration annotation with fields fooMin, fooMax, barMin, and barMax, and a generator MyObjectGen that can be configured with MyObjectConf. In configure I want to delegate to sub-generators. What is the proper way to do this?
My solution works but does not feel right, because I also hat to create an implementation of @InRange in order to configure the inner generators. I know I could configure the inner generators with annotations, but that does not seem to be practical either (when I have a lot of test methods each requiring a unique configuration).
On the other hand, I like the usage of my implementation, because how the parameter is configured matches that of the built-in generated parameters.
Hi,
How to properly delegate a generator configuration?
Assume
MyObject
has two attributes of the same type whose generators need to be configured. Let's sayfoo
andbar
are both integers, and I want to configure them with different ranges. I created a configuration annotation with fieldsfooMin
,fooMax
,barMin
, andbarMax
, and a generatorMyObjectGen
that can be configured withMyObjectConf
. Inconfigure
I want to delegate to sub-generators. What is the proper way to do this?My solution works but does not feel right, because I also hat to create an implementation of
@InRange
in order to configure the inner generators. I know I could configure the inner generators with annotations, but that does not seem to be practical either (when I have a lot of test methods each requiring a unique configuration).On the other hand, I like the usage of my implementation, because how the parameter is configured matches that of the built-in generated parameters.
What am I missing?
Thanks a lot!
The text was updated successfully, but these errors were encountered: