chevron-thin-right chevron-thin-left brand cancel-circle search youtube-icon google-plus-icon linkedin-icon facebook-icon twitter-icon toolbox download check linkedin phone twitter-old google-plus facebook profile-male chat calendar profile-male
Welcome to Typemock Community! Here you can ask and receive answers from other community members. If you liked or disliked an answer or thread: react with an up- or downvote.
0 votes
my problem,if i started build,i would like to with Unit test project build...

Where do I bug ?

<Import Project="C:Program Files (x86)TypemockIsolatorTypeMock.MSBuild.Tasks" />

  <Target Name="BeforeTest">
    <TypeMockStart LogPath="C:TypeMockLogs" LogLevel="9" Target="3.5" />
    <Exec ContinueOnError="false" WorkingDirectory="$(SolutionRoot)" Command="$(NUNIT) Business.Tests.dll" />
  </Target>
  <Target Name="AfterTest">
    <TypeMockStop Undeploy="true" />
  </Target>

  <PropertyGroup>
    <TypeMockLocation>C:BuildIsolator</TypeMockLocation>
    <NUNIT>"C:Program Files (x86)NUnit 2.6in
unit-console.exe"</NUNIT>
    <TMockRunnerPath>"C:Program Files (x86)TypemockIsolatorTMockRunner.exe"</TMockRunnerPath>
    <MSTestPath>"D:Program Files (x86)Microsoft Visual Studio 10.0Common7IDEMSTest.exe"</MSTestPath>
  </PropertyGroup>
asked by dispose (600 points)

1 Answer

0 votes
In order to run tests with MSBuild you need to use TypeMockStart & TypeMockStop tasks or instead use TMockRunner. The Simpler way is to use Start & Stop:

<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <TypeMockLocation>C:Program FilesTypeMockIsolator.0</TypeMockLocation>
        <NUnit>"C:Program FilesNUnitin
unit-console.exe"</NUnit>
    </PropertyGroup>

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

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

</Project>


This example assumes the build agent has Isolator installed. If it's not, you also need to call register task prior to Start, you can find the documentation to it here


Regards,
Alex, TypeMock Support
answered by alex (18k points)
...