Search⌘ K
AI Features

Setting up a NUnit Project

Explore how to set up a NUnit testing project within Visual Studio to write and run unit tests for C# console applications. Understand the process of configuring the .NET environment, creating application and test projects, and running passing and failing tests using NUnit. This lesson prepares you to organize and execute unit tests efficiently.

Introduction

Unit tests test code. Before writing unit tests, you will need to write and run code. Given that the course focuses on the NUnit testing framework, and that NUnit tests code written in the .NET supported languages (including C#), you will need to write and execute code in the C# language. To write and execute C# code, you will need to set up the requisite environments. Thereafter, you may set up the NUnit testing environment.

Setting up developing in C#

To develop in C# and to test C# code, you will need to set up the .NET environment. Fortunately, setting up the .NET environment is a seamless process. Follow the steps below to set up a .NET environment:

  • Source a computer with the Microsoft Windows/MacOS operating system (preferably Windows 10).
  • Download Visual Studio 2022 (community edition) with .NET at the following
...