We have Typemock 7.3.0.0 Essential with Resharper 7.1.1 and xUnit.
We are able to "Run" tests using the Resharper test runner, no problem.
We cannot "Debug" tests that use Typemock though - it results in an exception:
---
TypeMock.TypeMockException
*** Typemock Isolator is currently disabled. Enable using the following:
* Within Visual Studio:
- Use Typemock Smart Runner
- For other runners, Choose Typemock Menu and click Resume Mocking
* To run Typemock Isolator as part of an automated process you can:
- run tests via TMockRunner.exe command line tool
- use 'TypeMockStart' tasks for MSBuild or NAnt
For more information consult the documentation (see 'Running Unit Tests in an Automated Build')
---
Further investigation reveals that the Resharper test running process JetBrains.ReSharper.TaskRunner.CLR4.MSIL.exe has the following environment variable set, while debugging;
COR_PROFILER={b146457e-9aed-4624-b1e5-968d274416ec}
However, using Reflector I can see the following check in Typemock;
private static void a()
{
if ((Environment.GetEnvironmentVariable("COR_PROFILER") != "{B146457E-9AED-4624-B1E5-968D274416EC}") || (Environment.GetEnvironmentVariable("Cor_Enable_Profiling") != "0x1"))
{
if (Environment.GetEnvironmentVariable("COR_PROFILER") != "{D1087F67-BEE8-4f53-B27A-4E01F64F3DA8}")
{
throw new TypeMockException("Typemock Isolator is currently disabled. Enable using the following:
* Within Visual Studio:
- Use Typemock Smart Runner
- For other runners, Choose Typemock Menu and click Resume Mocking
* To run Typemock Isolator as part of an automated process you can:
- run tests via TMockRunner.exe command line tool
- use 'TypeMockStart' tasks for MSBuild or NAnt
For more information consult the documentation (see 'Running Unit Tests in an Automated Build')");
}
throw new TypeMockException("Typemock Isolator is currently disabled. Enable by turning off JustMock then Choose Typemock Menu and click Resume Mocking");
}
}
It would seem that Typemock does a default comparison (Ordinal, case sensitive) of the GUIDs as strings. Since the one defined in the environment variable is lower case, it fails.
I also notice that the COR_PROFILER for devenv.exe is uppercase {B146457E-9AED-4624-B1E5-968D274416EC}, as expected.
I also notice that the COR_PROFILER for JetBrains.ReSharper.TaskRunner.CLR4.MSIL.exe is uppercase {B146457E-9AED-4624-B1E5-968D274416EC}, while running.
I can't determine why this is lowercase while debugging, but uppercase while running.
Any tips?