próbuje dodać testy xUnit do mojego projektu ASP.NET 5, dodałem biblioteki klas i wypełnić project.json takiego:Visual Studio 2015 nie widzi moich testów xUnit
{
"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"
}
}
}
}
Ale Visual Studio nie rozpoznaje żadnego z moich testów jednostkowych w eksploratorze testowym:
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;
}
}
Czego mi brakuje?
Jakich wersji VS używasz i jakiego czasu (DNX/KRE)? –