Starting Typemock Isolator

The TypeMockStart task runs Typemock Isolator on the server.

To run TypeMockStart:

Add the TypeMockStart task to the project file with the following optional parameters:

Parameter

Description

Type

Mandatory/Optional

Target

.NET version.

Possible values:

2.0

3.0

3.5

3.0

4.0

4.5

String

Optional

LogPath

Path to log files (by default, it is the current user temporary directory)

String

Optional

Link

Integrates Typemock Isolator with a specified profiler

String

Optional

DisableAutoLink

Disables automatic integration with profilers

Boolean

Optional

Sample 1: Running NUnit Tests with Typemock Isolator

Because the best practice recommends to copy the Typemock Isolator DLLs to the source control repository, the following example assumes that the DLLs are stored there (see the TypemockLocation parameter). Your build can retrieve the files from the source control repository.

The original location of the DLLs is C:\Program Files (x86)\TypeMock\Isolator\<version>\TypeMock.MSBuild.dll.

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <TypeMockLocation>C:\Sources\TypeMock\ </TypeMockLocation>
    <NUnit>"C:\Program Files\NUnit\bin\nunit-console.exe"</NUnit>
  </PropertyGroup>

  <Import Project ="$(TypeMockLocation)\TypeMock.MSBuild.Tasks"/>

  <Target Name="TestWithTypeMock">
    <TypeMockStart/>
    <Exec ContinueOnError="true" Command="$(NUnit) Test.dll"/>
    <TypeMockStop/>
  </Target>
</Project>

Sample 2: Running NUnit Tests with Typemock Isolator and NCoverage in .NET 4.0
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <TypeMockLocation>C:\Sources\TypeMock\ </TypeMockLocation>
    <NUnit>"C:\Program Files\NUnit\bin\nunit-console.exe"</NUnit>
    <NCover>"C:\Program Files\NCover\NCover.Console"</NCover>
  </PropertyGroup>

  <Import Project ="$(TypeMockLocation)\TypeMock.MSBuild.Tasks"/>

  <Target Name="TestWithTypeMock">
    <TypeMockStart Target="4.0"/>
    <Exec ContinueOnError="true" Command=" $(NCover) //a Tested $(NUnit) Test.dll"/>
    <TypeMockStop/>
  </Target>
</Project>