How to run nunit with msbuild from VS2010

2020-05-19 08:38发布

please tell me how to run nunit with msbuild. I am using TFS for code integration and VS2010 .

1条回答
劳资没心,怎么记你
2楼-- · 2020-05-19 09:14

You probably want to integrate NUnit with TFSBuild and not MSBuild since you are using Team Foundation Server.

You will need MSBuild tasks to be able to run NUnit as explained in the three following tutorials:

The easiest way is to use the MSBuild Community Tasks where you already have a NUnit task ready to be used and you only will need to add a target to your msbuild file like so:

<Target Name="RunTests">  
    <!-- Run Unit tests -->  
    <CreateItem Include="$(OutDir)*.Tests.dll">  
      <Output TaskParameter="Include" ItemName="TestAssembly" />  
    </CreateItem>  
    <NUnit ToolPath="..\Tools\NUnit" DisableShadowCopy="true" Assemblies="@(TestAssembly)" />  
  </Target>
查看更多
登录 后发表回答