Following on the discussing on
this post, I found that the calloriginal setter property is not chainable. Here's the production code:
public class MyWrap
{
public Hulala baseAttach
{ get; set; }
}
public abstract class Hulala
{
public MyBase MBUnit
{ get; set;}
}
public class HulalaDerived: Hulala
{
}
public class MyBase
{
public double FirstNumber
{ get; private set; }
public MyBase()
{
FirstNumber = 10; }
}
And here's the test code:
[Test, Isolated]
public void BaseTop()
{
MyWrap wrap = Isolate.Fake.Instance<MyWrap>(Members.ReturnRecursiveFakes);
Isolate.WhenCalled(() => wrap.baseAttach.MBUnit = null).CallOriginal();
Isolate.WhenCalled(() => wrap.baseAttach.MBUnit).CallOriginal();
wrap.baseAttach.MBUnit=new MyBase();
Assert.IsNotNull(wrap.baseAttach.MBUnit);
}
The test will fail because the wrap.baseAttach.MBUnit is a null.
________
Jaguar XJ13 specifications