Let's say we have an enum type defined as:
enum Statuses
{
Completed,
Pending,
NotStarted,
Started
}
I'd like to make Autofixture create a value for me other than e.g. Pending.
So (assuming round-robin generation) I'd like to obtain:
Completed, NotStarted, Started, Completed, NotStarted, ...
fixture.Create<Statuses>()
(wherefixture
is anew Fixture()
instance) you will get eachStatuses
enum value in a round-robin fashion. You won't even need the link I previously mentioned. If that doesn't work then it would be great if you can update the question with some code that reproduces what you describe... – Hosanna