This runner supports xUnit.net tests for .NET 4.5.1+, and .NET Core 1.0+ (this includes ASP.NET Core 1.0+).
To install this package, ensure your project.json contains the following lines:
{
"dependencies": {
"xunit": "2.1.0",
"dotnet-test-xunit": "1.0.0-*"
},
"testRunner": "xunit"
}
To use xUnit configration, make sure to add buildOptions
to your project.json:
"buildOptions": {
"copyToOutput": {
"include": [ "xunit.runner.json" ]
}
}
To run tests from the command line, use the following.
# Restore NuGet packages
dotnet restore
# Run tests in current directory
dotnet test
# Run tests if tests are not in the current directory
dotnet -p path/to/project test // not yet implemented
For more complete example usage, please see Getting Started with xUnit.net and .NET Core / ASP.NET Core.