使用 Nunit 3 控制台的测试未 运行 正确

Tests are not running correctly with Nunit 3 console

我正在尝试 运行 使用 Nunit 3 控制台进行特定测试。 我没有收到任何错误,但执行了上述测试中的 none。

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

结果是

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

所以,事实上,测试没有 运行,尽管它说 Passed

测试没有执行,因为您需要将编译后的 DLL 的路径传递给 nunit3-console.exe,而不是 .csproj 文件。

大概是这样:

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

更多信息here