0
我想模擬一個使用Telerik JustMock的物業。Telerik JustMock a Property閱讀
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;
}
這是行不通的。它給出了一個例外,標題爲「奧普斯,有一些錯誤攔截目標電話。 - 例外」
任何想法?