In our project, we want the ability to use repeatable random seeds with bogus data. As far as I can tell, the underlying Bogus library supports this by using a common FakerHub across all Faker instances -- this "hub" can then have its Randomizer configured at any time, affecting all future generated data, and if Randomizer is repeatedly set to an object with the same seed, then the same sequence of calls to Bogus will produce the same sequence of bogus data.
This PR adds the ability to configure AutoBogus to inject a caller-supplied Faker in as the FakerHub for calls into the underlying Bogus layer.
Unit tests verify the new configuration builder functionality and the injection of the FakerHub value itself.
In our project, we want the ability to use repeatable random seeds with bogus data. As far as I can tell, the underlying Bogus library supports this by using a common
FakerHub
across allFaker
instances -- this "hub" can then have itsRandomizer
configured at any time, affecting all future generated data, and ifRandomizer
is repeatedly set to an object with the same seed, then the same sequence of calls to Bogus will produce the same sequence of bogus data.This PR adds the ability to configure
AutoBogus
to inject a caller-suppliedFaker
in as theFakerHub
for calls into the underlyingBogus
layer.Unit tests verify the new configuration builder functionality and the injection of the
FakerHub
value itself.