Hi Soon
Actually no :)
When you specify a chain inside WhenCalled method all the chain will be faked even if you use Members.CallOriginal on the controller instance.
The Members.CallOriginal argument is used as a default when methods and properties of the faked class are called and you didn't specified explicitly their behavior.
I see, I think I might have discover another bug ( or limitation?)
If I use CallsOn this ability seems to be lost. Here's my production code:
public class HoldHttpFileColllection
{
public HttpFileCollectionBase Files
{
get;
private set;
}
}
public class HHtpWrapper
{
public HoldHttpFileColllection filesCollection
{
get;
private set;
}
}
And here's the test code:
[Test, Isolated]
public void Test2()
{
HHtpWrapper myWrap = Isolate.Fake.Instance<HHtpWrapper>(Members.CallOriginal);
Isolate.Swap.CallsOn(myWrap.filesCollection.Files).WithCallsTo(new string[] { "hello" });
}
It seems that the CallsOn cannot take recursive faking; if I run the above code I will get a nullreferenceexception:
________
vaporizer wholesale