Hi
The problem is not the return type.
The reason for the exception is that you should tell
TypeMock what to return.
Example:
public class classSomething
{
public object MethodSomething()
{
throw new NotImplementedException();
}
}
[TestFixture]
public class TestClass
{
[Test]
public void Test()
{
using (RecordExpectations recorder = RecorderManager.StartRecording())
{
classSomething mock = new classSomething();
mock.MethodSomething();
recorder.Return(new object());
}
classSomething c = new classSomething();
//Assert code ..
}
}
The above example will pass the test.
If you will comment out the line:
recorder.Return(new object());
You'll get the same exception as in your example.
Hope it clears things up. 8)