xUnit v1 测试出现在 xUnit GUI (xunit.gui.clr4.exe) 中,但不出现在 VS 2012 测试资源管理器中 [英] xUnit v1 tests appear in xUnit GUI (xunit.gui.clr4.exe) but not VS 2012 Test Explorer

查看:12
本文介绍了xUnit v1 测试出现在 xUnit GUI (xunit.gui.clr4.exe) 中,但不出现在 VS 2012 测试资源管理器中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个 F# 类库,其中包含使用 NuGet 安装的xUnit.net"和xUnit.net Runners"包.我有以下代码:

I have an F# Class Library with the "xUnit.net" and "xUnit.net Runners" packages installed using NuGet. I have the following code:

module XUnitTest

open Xunit

[<Fact>]
let Test () =
    do Assert.True (1 = 2)
    ()

当我运行 xUnit GUI(xunit.gui.clr4.exe,NuGet 添加到(项目目录)packagesxunit.runners.1.9.1 ools),并加载这个项目构建的程序集时,Test() 方法出现,但在我运行时失败,正如预期的那样.

When I run the xUnit GUI (xunit.gui.clr4.exe, which NuGet adds to (projectdirectory)packagesxunit.runners.1.9.1 ools), and load the assembly built by this project, the Test () method appears, and fails when I run it, as expected.

但是,无论我重新构建、重新启动等多少次,我都无法让测试出现在 VS 2012 的测试资源管理器中.如果我单击全部运行",则会弹出构建输出窗口,但没有其他任何反应.

However, I cannot get the test to appear in VS 2012's Test Explorer, no matter how many times I rebuild, restart, etc. If I click Run All, the build output window pops up but nothing else happens.

最重要的是,我还安装了 xUnit.net 扩展,尽管我不认为它们对于我正在尝试做的事情是必要的.这也没有帮助.

For the heck of it I also installed the xUnit.net Extensions, though I don't believe they're necessary for what I'm trying to do. That didn't help either.

如果我能提供更多信息,请告诉我,感谢您的阅读!

Please let me know if I can provide additional information and thank you for reading!

推荐答案

很确定基于你需要安装 xUnit.net runner for Visual Studio 2012 VSIX 扩展 xUnit.net runners NuGet 包,详见相关 xUnit 文档页面.

Pretty sure based on the to/fro that you need to install xUnit.net runner for Visual Studio 2012 VSIX extension the xUnit.net runners NuGet package as detailed on the relevant xUnit docs page.

MSTest 等效项内置于标准 VS 安装中.

The MSTest equivalent is built in to a standard VS install.

这篇关于xUnit v1 测试出现在 xUnit GUI (xunit.gui.clr4.exe) 中,但不出现在 VS 2012 测试资源管理器中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆