NUnit Class

MSBuild Extension Pack

NUnit Class MSBuild Extension Pack Help 4.0.12.0
Executes Test Cases using NUnit (Tested using v2.6.2)
Inheritance Hierarchy

SystemObject  Microsoft.Build.UtilitiesTask
    Microsoft.Build.UtilitiesToolTask
      MSBuild.ExtensionPack.CodeQualityNUnit

Namespace: MSBuild.ExtensionPack.CodeQuality
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 4.0.0.0

The NUnit type exposes the following members.

Constructors

  NameDescription
Public methodNUnit
Top
Properties

  NameDescription
Public propertyAssemblies
Gets or sets the assemblies.
Public propertyConfiguration
Sets the Project configuration (e.g.: Debug) to load
Public propertyDomain
AppDomain Usage for tests. Supports None, Single, Multiple. The default is to use multiple domains if multiple assemblies are listed on the command line. Otherwise a single domain is used.
Public propertyErrorOutputFile
Sets the File to receive test error output
Public propertyErrors
Gets the Errors count
Public propertyExcludeCategory
Comma separated list of categories to exclude.
Public propertyFailOnFailures
Set to true to fail the task if this.Failures > 0. Helps for batching purposes. Default is false.
Public propertyFailures
Gets the Failures count
Public propertyFramework
Framework version to be used for tests
Public propertyIgnored
Gets the Ignored count
Public propertyIncludeCategory
Comma separated list of categories to include.
Public propertyInconclusive
Gets the Inconclusive count
Public propertyInvalid
Gets the Invalid count
Public propertyLabels
Label each test in stdOut. Default is false.
Public propertyNoShadow
Disable shadow copy when running in separate domain. Default is false.
Public propertyNoThread
Disable use of a separate thread for tests. Default is false.
Public propertyNotRun
Gets the NotRun count
Public propertyOutputFile
File to receive test output
Public propertyOutputXmlFile
Sets the OutputXmlFile name
Public propertyProcess
Process model for tests. Supports Single, Separate, Multiple. Single is the Default
Public propertyRun
Name of the test case(s), fixture(s) or namespace(s) to run
Public propertySkipped
Gets the Skipped count
Public propertyTestTimeout
Set timeout for each test case in milliseconds
Public propertyTotal
Gets the Total count
Public propertyUse32Bit
Set to true to run nunit-console-x86.exe
Public propertyVersion
The version of NUnit to run. Default is 2.6.2
Top
Examples

<Project ToolsVersion="4.0" DefaultTargets="Default" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup>
    <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath>
    <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath>
  </PropertyGroup>
  <Import Project="$(TPath)"/>
  <PropertyGroup>
    <ToolPath>D:\Program Files (x86)\NUnit 2.5.7\bin\net-2.0</ToolPath>
  </PropertyGroup>
  <Target Name="Default">
    <ItemGroup>
      <Assemblies Include="d:\a\*.dll"/>
    </ItemGroup>
    <!-- Run an NUnit Project -->
    <MSBuild.ExtensionPack.CodeQuality.NUnit Assemblies="d:\a\Project1.nunit" ToolPath="$(ToolPath)">
      <Output TaskParameter="Total" PropertyName="ResultTotal"/>
      <Output TaskParameter="NotRun" PropertyName="ResultNotRun"/>
      <Output TaskParameter="Failures" PropertyName="ResultFailures"/>
      <Output TaskParameter="Errors" PropertyName="ResultErrors"/>
      <Output TaskParameter="Inconclusive" PropertyName="ResultInconclusive"/>
      <Output TaskParameter="Ignored" PropertyName="ResultIgnored"/>
      <Output TaskParameter="Skipped" PropertyName="ResultSkipped"/>
      <Output TaskParameter="Invalid" PropertyName="ResultInvalid"/>
    </MSBuild.ExtensionPack.CodeQuality.NUnit>
    <Message Text="ResultTotal: $(ResultTotal)"/>
    <Message Text="ResultNotRun: $(ResultNotRun)"/>
    <Message Text="ResultFailures: $(ResultFailures)"/>
    <Message Text="ResultErrors: $(ResultErrors)"/>
    <Message Text="ResultInconclusive: $(ResultInconclusive)"/>
    <Message Text="ResultIgnored: $(ResultIgnored)"/>
    <Message Text="ResultSkipped: $(ResultSkipped)"/>
    <Message Text="ResultInvalid: $(ResultInvalid)"/>
    <!--- Run NUnit over a collection of assemblies -->
    <MSBuild.ExtensionPack.CodeQuality.NUnit Assemblies="@(Assemblies)" ToolPath="$(ToolPath)" OutputXmlFile="D:\a\NunitResults2.xml">
      <Output TaskParameter="Total" PropertyName="ResultTotal"/>
      <Output TaskParameter="NotRun" PropertyName="ResultNotRun"/>
      <Output TaskParameter="Failures" PropertyName="ResultFailures"/>
      <Output TaskParameter="Errors" PropertyName="ResultErrors"/>
      <Output TaskParameter="Inconclusive" PropertyName="ResultInconclusive"/>
      <Output TaskParameter="Ignored" PropertyName="ResultIgnored"/>
      <Output TaskParameter="Skipped" PropertyName="ResultSkipped"/>
      <Output TaskParameter="Invalid" PropertyName="ResultInvalid"/>
    </MSBuild.ExtensionPack.CodeQuality.NUnit>
    <Message Text="ResultTotal: $(ResultTotal)"/>
    <Message Text="ResultNotRun: $(ResultNotRun)"/>
    <Message Text="ResultFailures: $(ResultFailures)"/>
    <Message Text="ResultErrors: $(ResultErrors)"/>
    <Message Text="ResultInconclusive: $(ResultInconclusive)"/>
    <Message Text="ResultIgnored: $(ResultIgnored)"/>
    <Message Text="ResultSkipped: $(ResultSkipped)"/>
    <Message Text="ResultInvalid: $(ResultInvalid)"/>
  </Target>
</Project>
See Also

Reference