Unable to access a function using the mockobject created. Below is the sample code:
[DeploymentItem("xyz.dll")]
[TestMethod()]
public void UpdateXTest()
{
XSum mockXSum =RecorderManager.CreateMockedObject(typeof(XSum)) as XSum;
using (RecordExpectations recorder = RecorderManager.StartRecording())
{
mockXSum.UpdateX();
}
}
Whenever mockXSum.UpdateX() is executed, the code for test cleanup is executed and the test fails and the error message is,
*** Cannot return a value for AssemblyResolver.OnResolve() because no value was set. use recorder.Return().
*** Note: Cannot mock types from mscorlib assembly..
Code for test cleanup:
[TestCleanup()]
public void MyTestCleanup()
{
MockManager.Verify();
}
I am using TypeMock.NET version 4.1.0.0.
Note: I am able to call other function in XSum using the mockobject created.