I recently moved from TypeMock 6.0.8 to 8.1.1.11, and I've run into a behavior difference that causing tests to fail. I have many tests that mock methods with out parameters. They set the out parameter by establishing the expected value in the Isolate call:
string theValueIWantClientsToGet = "thisValue";
Isolate.WhenCalled(() => someMock.TryGet(out theValueIWantClientsToGet)).WillReturn(true);
The first call to TryGet will set the out parameter as I expect. The second call on ends up setting the out parameter to null.
I can work around this issue by changing to:
string theValueIWantClientsToGet = "thisValue";
Isolate.WhenCalled(() => someMock.TryGet(out theValueIWantClientsToGet)).DoInstead(
context =>
{
context.Parameters[0] = theValueIWantClientsToGet;
return true;
});
While this does resolve the issue, as a company we have thousands of existing tests, and we'd rather not have to #1 find all these cases and #2 modify test code that used to work.
Thanks,
-Kevin