Here's the production code
public class FSlab
{
public List<int> myInts
{ get; private set; }
public double Depth
{
get
{
return 0;
}
}
public FSlab(List<int> intList)
{
myInts = intList;
}
}
public class FPad
{
public FSlab fSlab
{ get; private set; }
public FPad(List<int> intList)
{
fSlab=new FSlab(intList);
}
}
And here's the test code:
[Test]
public void NullForNoReason()
{
var fp = new FPad(new List<int>());
Isolate.WhenCalled(() => fp.fSlab.Depth).WillReturn(450);
Assert.IsNotNull(fp.fSlab.myInts);
}
You will find that the above test fails at Assert.IsNotNull.
But if I disable the Isolate.WhenCalled then I won't have such a problem.
________
Motorcycle Tires