Handle Constructor Arguments

With ObjectFiller.NET it is possible to instantiate objects which have a constructor WITH arguments. In the above setup the address property in the class person gets ignored because it gets filled by the constructor. It is also possible to define a setup for the Adress by calling .SetupFor

in the fluent API. The address argument in the person constructor gets than filled with an address object which matches the configuration.

public class Person
{
  public Person(Address address)
  {
    Address = address;
  }

  public string Name { get; set; }
  public string LastName { get; set; }
  public int Age { get; set; }
  public DateTime Birthday { get; set; }
  public Address Address { get; set; }

}

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

public class HelloFiller
{
  public void FillPerson()
  {
    Filler<Person> pFiller = new Filler<Person>();
    pFiller.Setup()
      .OnProperty(x=>x.Address).IgnoreIt();

    Person filledPerson = pFiller.Create();
  }
}