Search code examples
visual-studio-2015asp.net-corexunitdnx

Tests are not visible by Visual Studio 2015


My tests are not visible in visual studio 2015 with DNX46 (Test > Windows > Test Explorer)

I can run them from the console (with dnx test). Bellow the project.json of my test project

{
  "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"
  }
}

I tried to install SideWaffle, maybe something was missing in my project, but same issue.


Solution

  • Humm the solution was to put the command after the dependencies declaration in 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"
      }
    }