Thanks again for reporting the issue. I found this bug with the latest release. This is happening due to future mocking
settings. However if you move the real instance code to a different test method, it will work as expected.
var fakeUsed = Mock.Create<UsedClass>();
Mock.Arrange(() => fakeUsed.ReturnFive()).Returns(7);
var realInstance =
Here i named the test in a way that mocked instance will be called first and then the real one. However if real instance executes first and invokes the OnJITCompilation started, you can still resolve the situation using the following block:
// puts a dummy interceptor
//so that calling real instance first wont break the test.
Mock.Partial<UsedClass>().For(x => x.ReturnFive());
Moreover, the bug in your test is valid as well and the fix will be available by end of this week. You can create a support ticket where i will send an internal build. However, it will also be available in the Q3 build coming next week.
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>