Search code examples
c#.netfakerbogus

Bogus C# - how to get completely randomized objects without listing RuleFor for every property?


Using C# Bogus library, I would like to generate completely random objects without enumerating all fields as RuleFor explicitly.

How I could configure my Faker to achieve that?


Solution

  • You can try AutoBogus here: https://github.com/nickdodd79/AutoBogus

    AutoBogus is a community extension written by Nick Dodd that "auto magically" creates default rules for properties of your POCO object. You can override those automatic rules that AutoBogus generates, in memory, with specific RuleFor() rules for unit test that expect specific values.