Closed weitzhandler closed 4 years ago
Hey @weitzhandler
If I understand your request, there is a WithSkip
config handler, but this is tied to members and not types. However you could look at the WithOverride
handler to provide something more generic and type based.
With regards to the number of objects to be generated for all collections, there is a WithRepeatCount
handler which specifies the number of items in a collection.
All these config handlers can be defined at a global, faker or generate level, and are all described in the readme file.
Nick.
Thank you. A WithSkip<Type>(Type type)
would be awesome.
I can PR if needed.
Hey @weitzhandler
Just an update that I have something in place for this, just running it through some tests. I'll let you know when it is released.
Nick.
Thanks for your input.
Don't forget to include Closes #38
in your post.
Hey @weitzhandler
Apologies for the delay. I finally found some time to get a fix in place for another issue I wanted to release. You should find your requested WithSkip
methods in v2.10.0.
An example usage is:
var instance = AutoFaker.Generate<MyClass>(builder =>
{
builder
.WithSkip<TypeToSkip>()
.WithSkip(typeof(AnotherTypeToSkip));
});
All properties and constructor parameters of type TypeToSkip
and AnotherTypeToSkip
will be skipped during the auto generate.
Wow, nice!
Hi and thanks for this wonderful library!