How to run nunit with msbuild from VS2010

你。 提交于 2019-12-02 19:12:06

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>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!