MisterJames / GenFu

GenFu is a library you can use to generate realistic test data. It is composed of several property fillers that can populate commonly named properties through reflection using an internal database of values or randomly created data. You can override any of the fillers, give GenFu hints on how to fill them.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feature: Set to one of a list of values

DevFojo opened this issue · comments

Set a property to one of the values from a list. Something like

A.Configure<Apparel>()
      .Fill(apparel => apparel.Type,
      type => OneOf({"Shirt","Trousers","Dress","Blouse","Skirt"});

This works today as follows;

A.Configure<Apparel>().Fill(apparel => apparel.Type).WithRandom(new []{"Shirt", "Trousers", "Dress", "Blouse", "Skirt"});

@MrFojo This one's baked in already, let us know if you have any questions around it!