I'm using c# Bogus.Faker library to create random test data for my unit tests.
I want to know how to easily pick a random enum value ?
Any suggestions?
Found the solution:
You have to use Faker.PickRandom<> method
i.TypeOfSchedule = Faker.PickRandom<Schedule>(); // with 'Schedule' of type Enum :-)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With