Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I install NUnit 3 console on Windows and run tests?

I want to run tests from a console like this (being in any directory, the DLL file can be for a different .NET version):

$ nunit3-console test.dll 

I googled a lot, but can't find how to set up this.

The official tutorial has nothing useful and is complete zero. Following it gets me nowhere: https://github.com/nunit/docs/wiki/Installation

like image 310
one_mile_run Avatar asked Aug 03 '17 11:08

one_mile_run


People also ask

How do I install NUnit console?

Unzip the file or install the MSI and then if you would like be able to run nunit3-console from the command line, put the bin directory, containing nunit3-console.exe on your path. In your test assemblies, add a reference to nunit. framework. dll, using the copy in the subdirectory for the appropriate runtime version.

How do you use the NUnit 3 test adapter?

A better option is to navigate to Tools -> Manage Extensions menu in Visual Studio. Click on Online and enter the search term as NUnit Test Adapter. Click on the search item labeled as NUnit 3 Test Adapter and install it. With this NUnit setup example, we demonstrated how to setup the NUnit framework for Visual Studio.


1 Answers

It is hard to find, because there is a lot of outdated documentation, either for NUnit2 or NUnit3.

Steps:

  1. Official NUnit3 console installers are here: https://github.com/nunit/nunit-console/releases (path is different than in docs)
  2. Download NUnit.Console-*.msi package and install
  3. Add to system PATH variable this: C:\Program Files (x86)\NUnit.org\nunit-console
  4. Open command line
  5. Type:

    $ nunit3-console test.dll

// For running multiple test assemblies in parallel see: https://stackoverflow.com/a/45486444/1453525

like image 105
one_mile_run Avatar answered Sep 25 '22 15:09

one_mile_run