-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
Currently the options are to let AnonymousData handle things entirely on it's own, or to provide a complete factory yourself. However, it's often the case that you just want to provide specific instructions for a few properties and allow AnonymousData to handle the rest. Some pseudo code to illustrate the idea (with no suggestion for final syntax on such a feature).
anon.RegisterWith<Person>(cfg => cfg.For(p => p.Age).Use(a => a.AnyInt(0, 100)).For(p => p.Secret).Ignore());So, AnonymousData would create a Person and populate most of the properties as it normally would, but for Age it generates an int between 0 and 100 and it doesn't populate Secret at all.
This will make "adjusting" the generation for complex types (especially complex trees of types) much simpler.