Git Product home page Git Product logo

dotnet-test-nunit's Introduction

NUnit 3 Test Runner for .NET Core

Deprecated

This project is deprecated. The test adapter API changed when .NET Core switched from project.json to the new csproj format. For newer .NET Core and .NET Standard projects, use the NUnit 3 Visual Studio Test adapter to run tests at the command line using dotnet test, in CI or in Visual Studio.

For more information on how to test .NET Core, see the .NET Core/.NET Standard documentation.

If you are reporting issues, we are no longer making updates to this project or the use of dotnet-test-nunit and project.json. Issues should be reported against the NUnit 3 Visual Studio Test adapter.

Build status Travis Build Status

dotnet-test-nunit is the unit test runner for .NET Core for running unit tests with NUnit 3.

Usage

dotnet-test-nunit is still an alpha release, so you need to select show prereleases if you are using Visual Studio.

Your project.json in your test project should look like the following;

project.json

{
    "version": "1.0.0-*",

    "dependencies": {
        "NUnit": "3.5.0",
        "dotnet-test-nunit": "3.4.0-beta-3"
    },

    "testRunner": "nunit",

    "frameworks": {
        "netcoreapp1.0": {
            "imports": "portable-net45+win8",
            "dependencies": {
                "Microsoft.NETCore.App": {
                    "version": "1.0.0-*",
                    "type": "platform"
                }
            }
        }
    }
}

The lines of interest here are the dependency on dotnet-test-nunit. I have added "testRunner": "nunit" to specify NUnit 3 as the test adapter. I also had to add to the imports for both the test adapter and NUnit to resolve.

You can now run your tests using the Visual Studio Test Explorer, or by running dotnet test from the command line.

# Restore the NuGet packages
dotnet restore

# Run the unit tests in the current directory
dotnet test

# Run the unit tests in a different directory
dotnet test test/NUnitWithDotNetCoreRC2.Test

Notes

Note that the dotnet command line swallows blank lines and does not work with color. The NUnit test runner's output is in color, but you won't see it. These are known issues with the dotnet CLI and not an NUnit bug.

dotnet-test-nunit's People

Contributors

charliepoole avatar chrismaddock avatar dmitriyse avatar dougkpowers avatar jcansdale avatar jplebre avatar rprouse avatar somdoron 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.