en-US/about_Whiskey_NUnit3_Task.help.txt

TOPIC
    about_Whiskey_NUnit3_Task
 
SUMMARY
    Runs NUnit3 tests.
 
DESCRIPTION
    The NUnit3 task runs NUnit tests. The latest version of NUnit 3 is downloaded from nuget.org for you (into a `packages` directory in your build root).
     
    The `Path` parameter is mandatory and must contain a list of paths, relative to your `whiskey.yml` file, to the assemblies for which NUnit tests should be run.
 
    By default, OpenCover runs NUnit and gathers test code coverage, saving its report to '.output\openCover\openCover.xml'. ReporterGenerator is used to convert the OpenCover report into an HTML report, viewable to '.output\openCover\index.html'. If you wish to **only** run NUnit tests, then specify the `DisableCodeCoverage` parameter with the value of `true`.
     
    The task will run NUnit tests with .NET framework `4.0` by default. You may override this setting with the `Framework` parameter.
         
    The task will fail if any of the NUnit tests fail (i.e. if the NUnit console returns a non-zero exit code).
 
    Test results are output as XML files into the build's output directory. Files are named "nunit3+RANDOM_STRING.xml", where "RANDOM_STRING" is random file name.
 
PROPERTIES
 
    * `Path` (*mandatory*): the path, relative to your `whiskey.yml` file, to the assemblies for which you want to run NUnit tests for.
    * `TestFilter`: a list of expressions indicating which tests to run. It may specify test names, classes, methods, categories, or properties comparing them with the actual values with the operators ==, !=, =~, and !=. The documentation for this expression language can be found here: https://github.com/nunit/docs/wiki/Test-Selection-Language If multiple `TestFilter` are given then they will be joined with a logical `or` operator.
    * `Framework`: framework type/version to use for tests. e.g. 4.0, 4.5, mono-4.0. The default is `4.0`.
    * `Argument`: a list of additional arguments to pass to the NUnit3 console.
    * `DisableCodeCoverage`: boolean value indicating whether or to run the NUnit test results against OpenCover and ReportGenerator.
    * `CoverageFilter`: a list of OpenCover filters to apply to selectively include or exclude assemblies and classes from OpenCover coverage results.
    * `OpenCoverVersion`: the version of OpenCover to use. Defaults to the latest version available.
    * `OpenCoverArgument`: a list of additional arguments to pass to the OpenCover console.
    * `ReportGeneratorVersion`: the version of ReportGenerator to use. Defaults to the latest version available.
    * `ReportGeneratorArgument`: a list of additional arguments to pass to the ReportGenerator console.
 
EXAMPLES
 
    ## Example 1
 
        Build:
        - NUnit3:
            Path:
            - RootAssembly.dll
            - subfolder\subAssembly.dll
 
    This example will run the NUnit tests for both the `RootAssembly.dll` and the `<build root>\subfolder\subAssembly.dll` with the default .NET framework version `4.0`. OpenCover and ReportGenerator will also be run against the results of the NUnit tests.
 
    ## Example 2
 
        Build:
        - NUnit3:
            Path:
            - Assembly.dll
            Framework: 4.5
            DisableCodeCoverage: true
 
    This example will run the NUnit tests for the `Assembly.dll` file using .NET framework 4.5. OpenCover and ReportGenerator will not be run after the NUnit tests have completed since `DisableCodeCoverage` was `true`.
 
    ## Example 3
 
        Build:
        - NUnit3:
            Path:
            - Assembly.dll
            TestFilter:
            - "cat == 'Slow Data Tests' && Priority == High"
            - "cat == 'Standard Tests'"
            Argument:
            - "--debug"
 
    This example will run the NUnit tests for the `Assembly.dll` file using the TestFilter of `(cat == 'Slow Data Tests' && Priority == High) or (cat == 'Standard Tests')` to select which tests to run. The NUnit console will be executed with the additional given argument `--debug`.
 
    ## Example 4
 
        Build:
        - NUnit3:
            Path:
            - Assembly.dll
            CoverageFilter:
            - "+[Open*]*"
            - "-[Open.Test]*"
            OpenCoverVersion: 4.6.519
            OpenCoverArgument:
            - "-showunvisited"
            ReportGeneratorVersion: 2.5.11
            ReportGeneratorArgument:
            - "-reporttypes: Latex"
            - "-verbosity:Verbose"
 
    This example will run all tests located in the `Assembly.dll` file using the default .NET framework version `4.0`. OpenCover version `4.6.519` will be run against against the NUnit test results with the `CoverageFilter` `+[Open*]* -[Open.Test]*` and with the argument `-showunvisited`. ReportGenerator version `2.5.11` will be run against the OpenCover results using the arguments `-reporttypes:Latex` and `-verbosity:Verbose`.