The Getting started with xUnit.net (.NET Core / ASP.NET Core) page describes how to run tests with dotnet test
command line.
It states that it requires a specific project.json, where we add xunit dependencies and test runner:
"testRunner": "xunit",
"dependencies": {
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-rc2-build10015"
}
If I try calling it from the parent directory:
C:\git\Project\test [master ≡]> dotnet test
dotnet-test Error: 0 : System.InvalidOperationException: C:\git\Project\test\project.json does not exist.
at Microsoft.DotNet.Tools.Test.TestCommand.GetProjectPath(String projectPath)
at Microsoft.DotNet.Tools.Test.TestCommand.DoRun(String[] args)
C:\git\Project\test [master ≡]>
Question: Is there a way to run all tests (multiple project.json) with a single dotnet test
?
dotnet
driver would need to be smarter for that. That is one of the argumentation why they will switch back to msbuild for the .NET Core build system. – Shoulddotnet vstest
. See #47633234 – Fouts