Search code examples
seleniumnunit-3.0nunit-console

Tests are not running correctly with Nunit 3 console


I'm trying to run specific test(s) with Nunit 3 console. I'm getting no errors , but none of the mentioned tests executed either.

nunit3-console --test=c8_test "D:\tfs\QA - Automation\Projects\CrmOnline16\CrmOnline16\CrmOnline16.csproj"

The result is

Runtime Environment
   OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1
  CLR Version: 4.0.30319.42000

Test Files
    D:\tfs\QA - Automation\Projects\CrmOnline16\CrmOnline16\bin\Debug\CrmOnline1
6.dll

Test Filters
    Test: c8_test

Run Settings
    DisposeRunners: True
    WorkDirectory: C:\Program Files (x86)\NUnit.org\nunit-console
    ImageRuntimeVersion: 4.0.30319
    ImageTargetFrameworkName: .NETFramework,Version=v4.5.2
    ImageRequiresX86: False
    ImageRequiresDefaultAppDomainAssemblyResolver: False
    NumberOfTestWorkers: 8

Test Run Summary
  Overall result: Passed
  Test Count: 0, Passed: 0, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2018-08-13 05:11:06Z
    End time: 2018-08-13 05:11:08Z
    Duration: 1.235 seconds

So , in fact, the test didn't run , although it says Passed


Solution

  • Tests did not execute because you need to pass the path to the compiled DLL to nunit3-console.exe, not the .csproj file.

    Something like so:

    "C:\Program Files (x86)\NUnit.org\nunit-console\nunit3-console.exe" <path\to\your\CrmOnline16.dll>
    

    More info here.