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

1

8

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?

Dialogist answered 16/1, 2020 at 10:58 Comment(1)
You can't as far as i know, all generation in bogus is done via the RuleFor or Faker syntax. There are alternatives to RuleFor; see this sample. But this is probably not what you are looking for.Forefinger
I
11

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.

Idolatrous answered 16/1, 2020 at 16:38 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.