Executing xUnit.net tests with Cake
In Chapter 8, Creating Continuous Integration Build Processes, in the LoanApplication build script section, we walked through the process of creating and running build steps using the Cake automation build script. Running unit tests and getting the test results and coverage from Visual Studio IDE, Visual Studio Code, or any other suitable IDE for building .NET and .NET Core applications is easier with the assistance of the xUnit console runner and xUnit adapter. However, for the CI process and the build process to be complete and effective, unit test projects should be compiled and executed as part of the build steps.
Executing xUnit.net tests in .NET projects
Cake has a rich support for running xUnit.net tests. Cake has two aliases for running the different versions of xUnit.net tests—xUnit for running earlier versions of xUnit.net and xUnit2 for Version 2 of xUnit.net. To use commands for the alias, the ToolPath to xUnit.net must be specified within the...