nickdodd79 / AutoBogus

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

Disable value types default value generation #48

Closed i2van closed 3 years ago

i2van commented 3 years ago

In some cases non default(T) value should always be generated for value type, e.g. bool should always be true or value should not be binary 0 in general. It may be useful for verifying manual/auto object mappings for example.

Looks like there is no way to configure that globally.

i2van commented 3 years ago

Workaround: builder.WithOverride(...);

nickdodd79 commented 3 years ago

Hey @i2van

Yes, you can use the WithOverride handler to implement how you want values to be generated if the auto generator is not valid for your use case.

Nick.