trying to add xunit tests to my ASP.NET 5 project, I added a class library and populated project.json as follows:
{ "version": "1.0.0-*", "description": "", "authors": [ "" ], "tags": [ "" ], "projectUrl": "", "licenseUrl": "", "dependencies": { "xunit": "2.1.0-beta2-build2981", "xunit.runner.visualstudio": "2.1.0-beta2-build1055" }, "commands": { "test": "xunit.runner.visualstudio" }, "frameworks": { "dnx451": { }, "dnxcore50": { "dependencies": { "System.Collections": "4.0.10-beta-22816", "System.Linq": "4.0.0-beta-22816", "System.Threading": "4.0.10-beta-22816", "Microsoft.CSharp": "4.0.0-beta-22816" } } } }
But Visual Studio does not recognize my unit tests in the test explorer:
public class Class1 { [Fact] public void PassingTest() { Assert.Equal(4, Add(2, 2)); } [Fact] public void FailingTest() { Assert.Equal(5, Add(2, 2)); } int Add(int x, int y) { return x + y; } }
What am I missing?
source share