GithubHelp home page GithubHelp logo

isabella232 / dotnet-new-nunit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from nunit/dotnet-new-nunit

0.0 0.0 0.0 91 KB

NUnit 3 Test Project for dotnet new command line interface

License: MIT License

C# 38.31% F# 22.43% Visual Basic .NET 39.26%

dotnet-new-nunit's Introduction

NUnit 3 Test Project Template for dotnet new CLI

Status History
nuget NUnit 3 Test Project Template for dotnet-new CLI
Windows Build status Build history for appveyor
Linux & Mac OSX Build Status Build history for travis-ci

This repository 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.

dotnet-new-nunit's People

Contributors

cartermp avatar chrismaddock avatar echo-8-era avatar halex2005 avatar jmarolf avatar jnm2 avatar nvborisenko avatar osiristerje avatar rprouse avatar sayedihashimi avatar zanaptak avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.