nickdodd79 / AutoBogus

A C# library complementing the Bogus generator by adding auto creation and population capabilities.
MIT License
431 stars 50 forks source link

Generate random number of elements for each collection individually #49

Closed i2van closed 3 years ago

i2van commented 3 years ago

There is no way to specify random number of elements for each collection individually, by default collections of 3 elements are generated.

One can change it using:

AutoFaker.Configure(builder =>
{
  builder.WithRepeatCount(random.Next(1, 10));
});

It means that all collections will have the same number of elements anyway.

It would be good to have somethig like:

AutoFaker.Configure(builder =>
{
  builder.WithRepeatCount(() => random.Next(1, 10));
});

In this case each new collection will have random number of elements.

nickdodd79 commented 3 years ago

Hey @i2van

This sounds like a great addition to the configurability of AutoBogus, I will get it implemented and a new version pushed.

Thanks, Nick.

nickdodd79 commented 3 years ago

Hey @i2van

I have just released v2.12.0 which includes the above.

Nick.