visual-studio-2015 - 使用 vstest 运行 xUnit 测试

标签 visual-studio-2015 asp.net-core xunit dnx vstest

我正在尝试使用 vstest.console.exe 运行我的 xUnit 单元测试,但没有找到测试。

我正在使用 vstest.console.exe来自 Visual Studio 2015,可在以下位置找到:

C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\CommonExtensions\ Microsoft\TestWindow



命令运行:
vstest.console.exe "C:\MyProject\artifacts\bin\UnitTest\Release\dnx451\UnitTest.dll" /TestAdapterPath:"C:\MyProject\packages"

回复:

Starting test execution, please wait...

Warning: No test is available in the provided sources. Make sure that installed test discoverers & executors, platform & framework version settings are appropriate and try again.



我也尝试过使用以下 TestAdapterPath 参数,但遇到了同样的问题:
/TestAdapterPath:"C:\MyProject\packages\xunit.runner.visualstudio"

/TestAdapterPath:"C:\MyProject\packages\xunit.runner.visualstudio\2.1.0-beta4-build1109"

/TestAdapterPath:"C:\MyProject\packages\xunit.runner.visualstudio\2.1.0-beta4-build1109\build" 

/TestAdapterPath:"C:\MyProject\packages\xunit.runner.visualstudio\2.1.0-beta4-build1109\build\_common"  
project.json文件:
{
  "dependencies": {
    "xunit": "2.1.0-beta4-build3109",
    "xunit.runner.dnx": "2.1.0-beta4-build134",
    "xunit.runner.visualstudio": "2.1.0-beta4-build1109"
  },
  "commands": {
    "test": "xunit.runner.dnx"
  },
  "frameworks": {
    "dnx451": { }
  }
}

我该如何运行这些测试?

编辑:使用 DNX beta6 运行时。

最佳答案

运行 dnx . test在你的项目上

关于visual-studio-2015 - 使用 vstest 运行 xUnit 测试,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32233590/

相关文章:

c# - EntityFramework Core Database First 不会以流畅方式生成主键

c# - Xunit 中类似于 Visual studio 测试中的 TestContext 的属性是什么?

visual-studio - VS2015RC MVC项目从beta4升级到beta5

css - 在 visual studio 2015 中嵌入字体

c# - 在启动中获取 Web 主机名

sql-server - Asp.net Core 2.2 将整个DB表存储在内存中EF Core

带有 2 个级别文件夹的 Asp.net vnext global.json 不起作用

visual-studio-2013 - 可以在 Visual Studio 2013 及更高版本中关闭 Peek Definition 吗?

xunit - 在 xUnit 2.x 中的我的测试类上使用多个 collectionfixture

c# - xunit 中的异常消息包含参数,因此我的测试失败