It seems that object returned from recursive fake operation is not recursive fake, by design?
Here's the production code
public class Layer
{
public List<string> Names
{
get;
set;
}
}
public class BaseClass
{
public Layer GetLayers
{
get
{
Layer ly = new Layer();
ly.Names = new List<string>();
return ly;
}
}
}
public class WrapperClass
{
public BaseClass InstanceObj
{
get;
private set;
}
}
And here's the test code, note that this test will fail
[Test, Isolated]
public void WrapperLayer()
{
WrapperClass wc = Isolate.Fake.Instance<WrapperClass>(Members.ReturnRecursiveFakes);
Layer ly = wc.InstanceObj.GetLayers;
Assert.IsNotNull(ly.Names);
}
I do think that ly.Names should be a fake object instead of a null, though.
________
herbalaire