MisterJames / GenFu

GenFu is a library you can use to generate realistic test data. It is composed of several property fillers that can populate commonly named properties through reflection using an internal database of values or randomly created data. You can override any of the fillers, give GenFu hints on how to fill them.
Other
831 stars 100 forks source link

Genfu Instances #147

Open marcoregueira opened 5 years ago

marcoregueira commented 5 years ago

It would be great to be able to create GenFu instances. That would reduce interferences in multithreaded scenarios, allow creating specialized generators and better support for DI environments.

For instance:

var childGenerator = new GenFuInstance();
var adultGenerator = new GenFuInstance();

childGenerator.Configure<Person>().Fill(x => x.Age).WithinRange(1, 10);
adultGenerator.Configure<Person>().Fill(x => x.Age).WithinRange(20, 100);

PR #146 implements this change with while keeping old static usage to avoid breaking changes.