Install the Unit Testing Templates

Before you install the templates, you must have a .NET 6 SDK installed and available to use on the command line. To check that the environment is set up correctly, enter dotnet --version on the command line: if successfully set up, a version number is returned.

Note: If you are building a container on a Linux/UNIX platform, the templates are automatically registered during the container build.
  1. Check the list of current sources in your NuGet repository:
    dotnet nuget list source

    A list of registered sources is displayed; if one of the sources is not your Micro Focus product installation directory, you need to add it.

  2. Add the new source to the registered list:
    dotnet nuget add source <product-install-dir>/NuGetPackages --name <source-name>

    where <product-install-dir> is the directory in which your Micro Focus product is installed, and <source-name> is the name given to the source in the repository.

    If you run the dotnet nuget list source command again, the new source is listed.

  3. Register the package containing the Unit Testing templates:
    dotnet new -i MicroFocus.DotNet.MFUNIT.Templates
    The following templates from the specified package are installed, ready for use:
    Template Use to:
    MFUnit Data Driven Test Case Create test case fixture files for data driven tests
    MFUnit Library Create a unit testing project
    MFUnit Test Case Create test case fixture files

    Refer to Using the dotnet Command Line Utility to Manage Unit Testing Projects for a list of example commands you can use to create and build unit testing projects in the .NET 6 environment.