I have a Class Library (Package) project, the new preview template in VS 2015 RTM from which I want to execute Xunit tests.
The solution builds fine but the Test Explorer doesn't find any tests. From the project.json you can see that I am only targeting net45, not dnx, so I am using xunit.runner.visualstudio.
{
"dependencies": {
"myproject": "",
"xunit": "2.1.0-*",
"xunit.runner.visualstudio": "2.1.0-*"
},
"frameworks": {
"net45": {
"frameworkAssemblies": {
"System.Runtime": "4.0.0.0"
}
}
}
}
When I change the project type to a normal Class Library, the tests are picked up. However since the code I am trying to test is a Class Library (package) project, referencing it from a normal Class Library is problematic and I was hoping that this would work. Is this (or some variation) possible?
Context
Normally this project type is used for ASP.NET 5, Core CLR, etc. Even though I'm only targeting net45, I am using it because I want to take advantage of the feature where I can seamlessly use local source code in place of a nuget package (via the global.json projects attribute). It makes it much easier to work on a package that depends upon another where I'm often making changes in both locally.