Nunit 3控制台无法正常运行测试

时间:2018-08-13 05:13:52

标签: selenium nunit-3.0 nunit-console

我正在尝试使用Nunit 3控制台运行特定的测试。 我没有收到任何错误,但是提到的测试也没有执行。

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

1 个答案:

答案 0 :(得分:1)

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

类似的东西:

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

更多信息here