【问题标题】:F# + xUnit - what could possibly go wrongF# + xUnit - 可能出什么问题
【发布时间】:2019-01-31 19:10:33
【问题描述】:

我刚刚在尝试在 VS 15.8.1 下配置 F# 4.5.0.0 以运行 xUnit 测试时碰了壁。这是有问题的回购:https://github.com/kkkmail/fSharp-xUnit。 当我尝试运行所有测试时,VS 会返回此消息:C:\GitHub\fSharp-xUnit\DummyApp\DummyApp\bin\Debug\DummyApp.exe C:\GitHub\fSharp-xUnit\DummyApp 中没有可用的测试\Tests\bin\Debug\Tests.dll C:\GitHub\fSharp-xUnit\DummyApp\DummyApp\DummyApp.fsproj C:\GitHub\fSharp-xUnit\DummyApp\Tests\Tests.fsproj。确保测试发现者和执行者已注册并且平台和框架版本设置正确,然后重试。

“DummyApp”和测试都是使用 VS 从头开始​​创建的,我在创建解决方案之前清除了所有临时文件和所有 nuget 缓存,如网络上不同地方所建议的那样。

【问题讨论】:

  • xunit.runner.visualstudio 添加到您的测试项目中
  • @CaringDev 非常感谢。那行得通。能否请您将其添加为答案。

标签: f# xunit


【解决方案1】:

TL;DRxunit.runner.visualstudio 添加到您的测试项目中。


为了发现测试,Visual Studio 依赖于它的测试运行器。这个测试运行器可以发现/运行所有测试框架的测试,这些框架实现了相应的适配器接口ITestDiscovererITestExecutor。对于 xUnit,这些接口在 VsTestRunner 中实现,并在 xunit.runner.visualstudio 中发布。

另见xUnit docs about running tests in VS

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2011-01-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-06-15
    • 2014-06-27
    • 1970-01-01
    相关资源
    最近更新 更多