我有简单的课
public class Simple
{
public virtual int VirtualProperty { get; set; }
}
当我跑步时(FakeItEasy.1.13.1)
var strict = A.Fake<Simple>(options => options.Strict());
A.CallTo(() => strict.VirtualProperty).CallsBaseMethod();
strict.VirtualProperty = 999;
我收到一个错误
Call to non configured method "set_VirtualProperty" of strict fake.
我必须
var strict = A.Fake<Simple>(options => options.Strict());
A.CallTo(strict).Where(a => a.Method.Name == "get_VirtualProperty").CallsBaseMethod();
A.CallTo(strict).Where(a => a.Method.Name == "set_VirtualProperty").CallsBaseMethod();
strict.VirtualProperty = 999;
CallBaseMethod () 是否适用于虚拟财产?我究竟做错了什么?