NUnit3.DotNetNew.Template 1.8.1

There is a newer version of this package available.
See the version list below for details.
dotnet new install NUnit3.DotNetNew.Template::1.8.1                
This package contains a .NET Template Package you can call from the shell/command line.

This package contains a set of project and item templates to be used when creating projects from .NET Core dotnet new command line interface (C#, F# and Visual Basic project templates are supported).

Currently, it contains a project template for a NUnit test library targeting .NET Core.

Installation

To install NUnit Project and Item Templates from nuget, run command:

dotnet new -i NUnit3.DotNetNew.Template

Usage

Project Templates

To create new NUnit library project from template, run:

dotnet new nunit

By default it will create NUnit Test Project targeted to netcoreapp3.0. You can specify --framework command line switch to change targeting:

dotnet new nunit --framework netcoreapp1.1

To specify new folder name for your NUnit Test Project you can use -n switch. Following command will create NUnit-Tests folder and will generate NUnit Test Project there:

dotnet new nunit -n NUnit-Tests --framework netcoreapp1.0

If you'd like to create F# or VB test project, you can specify project language with -lang switch:

dotnet new nunit -lang F#
dotnet new nunit -lang VB

Note that VB doesn't support dashes in project name. If you have dotnet-new-nunit-example.vbproj test project, then you'll get compiler error like this:

vbc : error BC30113: 'dotnet-new-nunit-example' is not a valid name and cannot be used as the root namespace name. [/home/hal/git/dotnet-new-nunit-example/dotnet-new-nunit-example.vbproj]

To workaround this compiler error, rename your project so that it contained no dashes.

Item templates

To create new C# NUnit test fixture class (with name of folder where it will be created), run:

dotnet new nunit-test

You can specify filename of test fixture class with -n or --name parameter:

dotnet new nunit-test -n MyTestFixture

Unfortunately, this command will create file MyTestFixture\MyTestFixture.cs relatively of current directory.

You can create file MyTestFixture.cs in current directory by overriding output directory with -o or --output parameter:

dotnet new nunit-test -n MyTestFixture -o .

If you'd like to create F# or VB test fixture class, you can specify project language with -lang switch:

dotnet new nunit-test -lang F#
dotnet new nunit-test -lang VB

More information

For more info on dotnet new CLI, please read the documentation.

For more info on NUnit testing framework, see nunit.org website.

License

This package is distributed under conditions of MIT license.

This package has no dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
1.9.0 37,424 3/31/2022
1.8.1 119,225 4/15/2020
1.8.0 16,582 3/27/2020
1.7.2 128,731 3/18/2020
1.7.1 84,170 11/12/2019
1.7.0 30,908 10/25/2019
1.6.5 206,028 11/12/2019
1.6.4 22,248 10/25/2019
1.6.3 92,488 8/6/2019
1.6.2 5,287 4/9/2019
1.6.1 209,900 1/11/2019
1.6.0 241,930 11/20/2018
1.5.3 403,606 10/24/2018
1.5.2 6,544 9/12/2018
1.5.1 39,735 6/7/2018
1.5.0 4,583 6/5/2018
1.4.0 9,892 3/20/2018
1.3.0 7,391 11/14/2017
1.2.0 4,614 11/8/2017
1.1.0 4,997 7/24/2017
1.0.1 4,614 5/31/2017
1.0.0 4,773 5/30/2017

- NUnit v3.12.0
- NUnit3TestAdapter v3.16.1
- Microsoft.NET.Test.Sdk v16.5.0
- add new `--framework` supported parameters: net5.0
- update all project templates to default to net5.0. Other frameworks can still be selected with the `--framework` command line option.