To use a randomizer plugin you have to setup a property or type in the ObjectFiller.
In the following example we use the CityName plugin for the property
City
in the class Address
. We also setup the type integer to use the IntRange plugin. Within the constructor of the IntRange plugin we define that every housenumber should be a number between 1 and 38.
public class Address
{
public string City { get; set; }
public int HouseNumber { get; set; }
}
public class HelloFiller
{
public void FillPerson()
{
Filler<Address> pFiller = new Filler<Address>();
pFiller.Setup()
.OnProperty(x => x.City).Use(new CityName())
.OnType<int>().Use(new IntRange(1, 38));
Address address = pFiller.Create();
}
}