2

When I open the Test Explorer, I do not see my tests, even after a rebuild. I can run the tests using dnx . test and they run as expected.

My project.json file is listed below. I am using ASP.Net 5 beta6 with xUnit 2 and Visual Studio 2015 (beta 6).

{
  "version": "1.0.0-*",
  "description": "ClassLibrary1 Class Library",
  "authors": [ "jriegel" ],
  "tags": [ "" ],
  "projectUrl": "",
  "licenseUrl": "",

  "dependencies": {
    "System.Collections": "4.0.10",
    "System.Linq": "4.0.0",
    "System.Threading": "4.0.10",
    "System.Runtime": "4.0.20",
    "Microsoft.CSharp": "4.0.0",
    "xunit": "2.1.0-beta3-*",
    "xunit.runner.dnx": "2.1.0-beta3-*"
  },
  "commands": {
    "test": "xunit.runner.dnx"
  },

  "frameworks": {
    "dnx451": { },
    "dnxcore50": { }
  }
}
Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147
Jeff Riegel
  • 83
  • 2
  • 7
  • what are your exact versions of xunit and xunit.runner.dnx packages? does it help to close ([x]) the test explorer window, rebuild and open it again (for me, this was the solution...)? – metalheart Oct 20 '15 at 07:54

1 Answers1

0

The new xUnit Visual Studio runner package is compatible with Visual Studio 2015 and integrates with the Test Explorer.

Just run

install-package xunit.runner.visualstudio

and rebuild the project. Test discovery will pick up everything in your project.

If anyone is having trouble even after installing the package, the runner documentation lists a caveat:

If you've previously installed the xUnit.net Visual Studio Runner VSIX (Extension), you must uninstall it first. The Visual Studio runner is only distributed via NuGet now. To remove it, to go Tools > Extensions and Updates. Scroll to the bottom of the list, and if xUnit.net is installed, uninstall it. This will force you to restart Visual Studio.

Nate Barbettini
  • 51,256
  • 26
  • 134
  • 147