问题描述
我有一个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(xGet.gui.clr4.exe,NuGet将其添加到(projectdirectory)\ packages \ xunit.runners.1.9.1 \ tools),并加载由该项目构建的程序集时,测试()方法出现,并且按预期运行时失败.
When I run the xUnit GUI (xunit.gui.clr4.exe, which NuGet adds to (projectdirectory)\packages\xunit.runners.1.9.1\tools), 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运行程序NuGet程序包,有关xUnit docs页面上有详细介绍.
Pretty sure based on the to/fro that you need to install 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 Test Explorer中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!