Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>Show Test ResultsNew to Visual Studio Code? Get it now.
Show Test Results

Show Test Results

EffectiveLabs

|
7,110 installs
| (2) | Free
TDD support for NUnit .Net Core. Shows the tests results directly your code.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

vscode-nunit-tdd-extension

This extension is useful for C# developers, practicing TDD with NUnit under Visual Sudio Code.

The benefits

Improving the TDD experience with Visual Studio Code by showing NUnit tests results directly in vscode.

You don't need to inspect the TestResults.xml file or the console output in order to check if the tests passed or failed.

test results

How it works

1. Activate the command

activate the command

2. Run the tests

run tests

3. Observe the results directly in your test classes

test results

How to setup your project

Setup NUnit on your project

  • We recommend to split the code source of your application and the tests in two different projects and folders. Project structure
  • Create a global.json file in the root folder of your application
{
    "projects": [
        "src",
        "test"
    ]
}

Project structure

  • Setup your tests project by editing it's project.json file in order to add the dependency on your source project and on NUnit library.
{
    "version": "1.1.0-*",

    "dependencies": {
        "Spikes": {
            "target": "project"
        },
        "NUnit": "3.4.0",
        "dotnet-test-nunit": "3.4.0-beta-2"
    },
    "testRunner": "nunit",

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

Setup in VS Code the test task

Edit .vccode/tasks.json file

{
    "version": "0.1.0",
    "command": "dotnet",
    "isShellCommand": true,
    "args": [],
    "tasks": [
        {
            "taskName": "build",
            "args": [
                "src/Spikes"
            ],
            "isBuildCommand": true,
            "problemMatcher": "$msCompile"
        },
        {
            "taskName": "test",
            "isTestCommand": true,
            "args": [
                "test/Spikes.test"
            ]
        }
    ]
}

Useful resources

NUnit for .Net Core repository

Maintenance and Feedback

This extension is maintained by Ionut Mihalcea (ionut.mihalcea@effective-labs.fr)

Known Issues

Please use the "dotnet-test-nunit": "3.4.0-beta-2"

If you are using the "dotnet-test-nunit": "3.4.0-beta-3" the extension will not work. This version of the NUnit test adapter produces an invalid TestResults.xml file as documented here https://github.com/nunit/nunit.portable.agent/pull/16

Enjoy!

vscode-nunit-tdd-extension

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft