到 Visual Studio 2015 年,测试不可见

Tests are not visible by Visual Studio 2015

我的测试在 visual studio 2015 年使用 DNX46 时不可见(测试 > Windows > 测试资源管理器)

我可以从控制台 运行 他们(使用 dnx 测试)。下面是我的测试项目

的project.json
{
  "version": "1.0.0-*",
  "description": "project Class Library",
  "authors": [ "me" ],
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",
  "frameworks": {
    "dnx46": { }
  },
  "commands": {
    "test": "xunit.runner.dnx"
  },
  "dependencies": {
    "Microsoft.AspNet.TestHost": "1.0.0-rc1-final",
    "NSubstitute": "1.9.2",
    "Search": "1.0.0-*",
    "Search.Infrastructure": "1.0.0-*",
    "Search.Model": "1.0.0-*",
    "Swagger.Net.UI": "1.1.0",
    "xunit": "2.1.0",
    "xunit.runner.dnx": "2.1.0-rc1-build204"
  }
}

我尝试安装 SideWaffle,也许我的项目中缺少某些东西,但同样的问题。

嗯,解决方案是将命令放在 project.json

中的依赖项声明之后
{
  "version": "1.0.0-*",
  "description": "project Class Library",
  "authors": [ "me" ],
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",
  "frameworks": {
    "dnx46": { }
  },
  "dependencies": {
    "Microsoft.AspNet.TestHost": "1.0.0-rc1-final",
    "NSubstitute": "1.9.2",
    "Search": "1.0.0-*",
    "Search.Infrastructure": "1.0.0-*",
    "Search.Model": "1.0.0-*",
    "Swagger.Net.UI": "1.1.0",
    "xunit": "2.1.0",
    "xunit.runner.dnx": "2.1.0-rc1-build204"
  },
  "commands": {
    "test": "xunit.runner.dnx"
  }
}