As part of the configuration I added the required targets to enable TypeMock. In BeforeTest I have TypeMockStart and in AfterTest I have TypeMockStop.
When Team Build runs the unit tests and TypeMock throws an exception that it is not enabled:
Test method MyApp.Services.Messages.UnitTests.DtoTest.Decompose_WillMapProperties threw exception: TypeMock.TypeMockException:
*** Typemock Isolator is not currently enabled.
To enable do one of the following:
* 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
* To work with Typemock Isolator inside Visual Studio.NET:
set Tools->Enable Typemock Isolator from within Visual Studio
For more information consult the documentation (see 'Running' topic).
Yet when I open up the test project on the build machine and run it, everything works fine. Looking at the build log files I can see the tasks are running:
1>Target "BeforeTest" in file "C:ProjectsMyAppMain-CIBuildTypeTFSBuild.proj" from project "C:ProjectsMyAppMain-CIBuildTypeTFSBuild.proj":
Using "TypeMockStart" task from assembly "C:Program FilesTypemockIsolator.4TypeMock.MSBuild.dll".
Task "TypeMockStart"
Done executing task "TypeMockStart".
1>Done building target "BeforeTest" in project "TFSBuild.proj".
...
1>Target "AfterTest" in file "C:ProjectsMyAppMain-CIBuildTypeTFSBuild.proj" from project "C:ProjectsMyAppMain-CIBuildTypeTFSBuild.proj":
Using "TypeMockStop" task from assembly "C:Program FilesTypemockIsolator.4TypeMock.MSBuild.dll".
Task "TypeMockStop"
1:17>CoreTestConfiguration:
Task "TestToolsTask" skipped, due to false condition; ( '$(IsDesktopBuild)'=='true' and '$(V8TestToolsTask)'!='true' and '@(LocalTestContainer)' != '' ) was evaluated as ( 'false'=='true' and 'false'!='true' and '' != '' ).
1:17>Done building target "CoreTestConfiguration" in project "TFSBuild.proj".
1:17>Target "TestConfiguration" in file "C:Program FilesMSBuildMicrosoftVisualStudioTeamBuildMicrosoft.TeamFoundation.Build.targets" from project "C:ProjectsMyAppMain-CIBuildTypeTFSBuild.proj":
Building target "TestConfiguration" completely.
No input files were specified.
1:17>Done building target "TestConfiguration" in project "TFSBuild.proj".
1:17>Done Building Project "C:ProjectsMyAppMain-CIBuildTypeTFSBuild.proj" (TestConfiguration target(s)).
1:16>Done executing task "MSBuild".
1:16>Done building target "RunTest" in project "TFSBuild.proj".
1:16>Done Building Project "C:ProjectsMyAppMain-CIBuildTypeTFSBuild.proj" (RunTest target(s)).
1>Done executing task "TypeMockStop".
Any thoughts on why this might be failing?
Thanks,
Colin