我试图利用Telerik JustMock对财产进行 mo弄。
public WorkitemBusinessObject mock()
{
var mockContext = Mock.Create<BusinessObjectContext<Workitem>>();
var workitemList = new List<Workitem> {
new Workitem {Title="First Workitem"}
};
Mock..Arrange(() => mockContext.Table).Returns(workitemList.AsQueryable<Workitem>);
Mock.Arrange(() => mockContext.Query).CallOriginal();
Mock.Arrange(() => BusinessObjectContext<Workitem>.TableName).CallOriginal();
node.context = mockContext;
return this;
}
这并不可行。 除标题“Opps ”外,还有一些错误拦截目标电话。 - 例外”
任何想法?