I am trying to mock a Property using Telerik JustMock.
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;
}
This does not work. It gives an exception with the title "Opps , there were some error intercepting target call. - Exception"
Any ideas?