Documentation

Properties which are of type IEnumerable<T> like lists or dictionaries can also be filled by ObjectFiller.NET like it is shown in the following example.

If you want to specify how the list will get filled by the Objectfiller.NET take a look at the Collectionizer Plugin !

public class Person
{
  public Dictionary<string, List<Address>> 
    	SenselessDictionary { get; set; }
  
  public List<IAddress> SenselessList { get; set; }
}

public class Address : IAddress
{
  public string Street { get; set; }
  public string City { get; set; }
}

public interface IAddress { }

public class HelloFiller
{
  public void FillPerson()
  {
    Filler<Person> pFiller = new Filler<Person>();
    pFiller.Setup()
    .OnType<IAddress>().CreateInstanceOf<Address>();

    Person filledPerson = pFiller.Create();
  }
}