Hi
We have a known bug when trying to debug inside the recording block.
The bug you posted is different though.
Until we'll fix it please try the solution below:
The workaround for the problem is to debug using another runner.
You can use
TestDriven.NET
This will let debug from Visual Studio
(Right click on the test method-> Test with -> Debugger)
Another option is to use one of the NUnit runners nunit-console.exe or nunit.exe
To run them with TypeMock enabled use TMockRunner.exe e.g:
<TypeMocklPath>TMockRunner.exe <NunitPath>
unit.console.exe MyTest.dll
You should place the line: System.Diagnostics.Debugger.Break();
at the start of the debugged method.
So the test method will look like this:
public void ExampleTest()
{
System.Diagnostics.Debugger.Break();
using (RecordExpectations recorder = RecorderManager.StartRecording())
{
FunctionToMock(2);
recorder.CheckArguments();
recorder.Return(2);
}
Assert.AreEqual(2, Function(2));
}
This will halt execution and let you choose a debugger.
You can than stop anywhere inside the test as long as it is outside the recording block.
Please tell me if it helps.