xUnit v1 tests appear in xUnit GUI (xunit.gui.clr4.exe) but not VS 2012 Test Explorer

女生的网名这么多〃 提交于 2019-12-18 05:05:06

问题


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)
    ()

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.

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.

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!


回答1:


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.

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




回答2:


Be sure to search Including Prereleases. The package you need is 'xUnit.net [Visual Studio Runner]', which is a prerelease. If you only search for Stable releases, you will only find 'xUnit.net: Runners', which will not work in Visual Studio.



来源:https://stackoverflow.com/questions/16647789/xunit-v1-tests-appear-in-xunit-gui-xunit-gui-clr4-exe-but-not-vs-2012-test-exp

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!