ObjectFiller.NET icon indicating copy to clipboard operation
ObjectFiller.NET copied to clipboard

IgnoreInheritance does not work for reference types

Open HerrLoesch opened this issue 9 years ago • 0 comments

I have following classes:

public class A 
{
    public  string Test { get; set; }
}

public class B
{
    public A MyA {get; set; }
}

public class C : B
{
    public string AnotherProperty {get;set;}
}

I have configured the filler as followed:

var filler = new Filler<C>();
filler.Setup().IgnoreInheritance();
var c = filler.Create();

I woul expect that Cs property "MyA" is null but its actually an empty A.

HerrLoesch avatar Jul 19 '16 07:07 HerrLoesch