【问题标题】:Visual Studio 2017 - Test Runner - Debug Selected Tests - NUnit - Not WorkingVisual Studio 2017 - 测试运行器 - 调试选定的测试 - NUnit - 不工作
【发布时间】:2019-03-28 15:37:59
【问题描述】:

在 Visual Studio 2017 中运行 Debug Selected Tests 时,调试器只是短暂启动并关闭,选定的测试变成带有感叹号的蓝色图标(不确定的测试)。

Debug 的输出窗口显示:

The program '[1852] testhost.x86.exe: Program Trace' has exited with code 0 (0x0).
The program '[1852] testhost.x86.exe' has exited with code 0 (0x0).

使用Run Selected Tests 命令时也会发生类似的情况(自然不会弹出调试会话)。

有趣的是,运行 Test -> Run -> All TestsTest -> Debug -> All Tests 工作正常。

项目中的单元测试是针对NUnit 3.x 框架编写的。

【问题讨论】:

    标签: visual-studio visual-studio-2017 nunit visual-studio-test-runner


    【解决方案1】:

    解决方案是将缺少的 Nuget 包 NUnit3TestAdapter 添加到单元测试项目中。之后,Debug Selected TestsRun Selected Tests 两个选项都开始按预期工作。

    Install-Package NUnit3TestAdapter
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2021-11-30
      • 1970-01-01
      • 2012-11-19
      • 1970-01-01
      • 2022-07-11
      • 1970-01-01
      • 1970-01-01
      • 2011-10-12
      相关资源
      最近更新 更多