. NETCoreCLI tool documentation dotnet-test
Name
Dotnet-test-run the unit test with the configured test runner
Summary
'Dotnet test [-- configuration]
[--output] [--build-base-path] [--framework] [--runtime][--no-build][--parentProcessId] [--port] [
]`
Description
The dotnet test command is used to execute unit tests in a given project. A unit test is a class library project that depends on the unit test framework (such as NUnit or xUnit), and the unit test framework is used for the dotnet test runner.
The test project must use the "testRunner" node in project. json to specify a test runner attribute. This value should contain the name of the unit test framework.
The following example project. json shows the required attributes:
{ "version": "1.0.0-*", "buildOptions": { "debugType": "portable" }, "dependencies": { "System.Runtime.Serialization.Primitives": "4.1.1", "xunit": "2.1.0", "dotnet-test-xunit": "1.0.0-rc2-192208-24" }, "testRunner": "xunit", "frameworks": { "netcoreapp1.0": { "dependencies": { "Microsoft.NETCore.App": { "type": "platform", "version": "1.0.0" } }, "imports": [ "dotnet5.4", "portable-net451+win8" ] } }}
Dotnet test supports two running modes:
Console: in console mode, dotnet test fully executes any command passed to it and outputs the result. At any time you call dotnet test without passing -- port. it runs in console mode, which in turn leads to running in console mode.
Design phase: used in the context of other tools, such as editors or integrated development environments (IDEs. You can find it in dotnet-test protocol