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

后端 未结 4 386
不思量自难忘°
不思量自难忘° 2021-02-02 08:57

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
4条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-02-02 09:06

    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

提交回复
热议问题