Playing with NUnit - [Unit Testing with NUnit] - Part 2 [English]

Опубликовано: 10 Июль 2026
на канале: Learn In Urdu
442
5

This is second part of videos series "Unit Testing with NUnit". In this video, you will learn how you can use NUnit to write & execute your test cases.

Part 1 can be found here
   • Introduction to Unit Testing - [Unit Testi...  

------------------------
NUnit
Open source unit testing framework for .NET applications
https://github.com/nunit


Steps (how to use it)
Create a Console Application
Add a Class in it (e.g. Magician) and one method in it
Add Class Library Project in your solution
Install nunit Package (current is 3.11.0)
Install-Package NUnit -Version 3.11.0
Check & Install “NUnit Test Adapter 3” Extension
Add a class to write Test Cases
Apply [TestFixture] attribute on class
Add methods in this class
Apply [Test] or [TestCase] attributes on method



You normally do three things (AAA) in your Test method
Arrange (Prepare result)
Act (Call method to be tested)
Assert (Check result with expected value)