Blake Rivell Blake Rivell - 1 year ago 90
C# Question

VS Test Explorer is not finding my Unit Tests (XUnit.Runner) ASP.NET 5

I am using ASP.NET 5 with XUnit and Visual Studio is not finding my Tests in the test explorer.

I have rebuilt my project several times to get them to refresh. My test explorer is empty.

Any ideas?

Here is my project.json file:

"version": "1.0.0-*",
"description": "TestLibrary",
"authors": [ "brivell" ],
"tags": [ "" ],
"projectUrl": "",
"licenseUrl": "",

"dependencies": {
"AutoFixture": "3.38.1",
"AutoFixture.AutoMoq": "3.38.1",
"BusinessLibrary": "1.0.0-*",
"xunit": "2.1.0",
"xunit.runner.dnx": "2.1.0-rc1-build204"

"frameworks": {
"dnx451": { }

Here is an example of one my my tests:

public void Traditional()
// Arrange
var sut = new Calculator();

// Act

// Assert
Assert.True(sut.Value < 0);

Answer Source

You need to install the package XUnit.Runner.Console in your test project in order for the test runner to discover your tests.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download