Running NUnit tests using Azure Pipelines
NUnit is one of the many open source testing frameworks popular with cross-platform developers. In this recipe, we'll learn how easy it is to create a pipeline for NUnit-based tests and publish the test execution results in Azure DevOps Server.
Getting ready
In this section, we'll use the .NET CLI to create a new solution and a new class library project, and install the NUnit test template.
These are the prerequisites:
- .NET Core 2.1 SDK or later versions
- A text editor or code editor of your choice
Follow these steps:
- Launch Command Prompt and create a new folder called
ContinuousTesting
:
mkdir ContinuousTesting cd ContinuousTesting
- Create a new solution:
dotnet new sln -n prime
- Create a new
PrimeService
directory:
mkdir PrimeService
- Set
PrimeService
as the current directory and create a new project:
dotnet new classlib
- Rename
Class1.cs
toPrimeService.cs.
Start by copying this failing implementation of thePrimeService
class:
using System; namespace Prime.Services...