NUnit Assert class is used to determine whether a particular test method gives expected result or not.
In a test method, we write code the check the business object behavior. That business object returns a result. In Assert method we match the actual result with our expected result. If result comes according to our expect result then our test case is passed e...

In this C# NUnit tutorial, we'll learn about how to pass same type of objects array into test method and how to control the execution order of test methods.
NUnit TestCase Array
Below is the example of passing array to a test method.
[TestCase(new int[] { 2, 4, 6 })]
public void When_AllNumberAreEven_Expects_AreAllNumbersEvenAsTrue(int[] numbers)
{
N...

In our last tutorial, we learned about NUNit TestFixture attribute. In this tutorial, we learn about NUnit TestCase attribute and its usage.
TestCase attribute is used for two purposes.
It marks a method to Test Method.
Pass arguments / parameters to Test Method.
Test Method
When we assign TestCase attribute to any method that lets NUnit test runner ...

In our previous post, we learn how to set up environment for our NUnit Project. In this post, we'll learn how to write our first NUnit Test Case with Example in .NET / C#.
We have two projects CustomerOrderService project which is a class library and CustomerOrderService.Tests project which is a NUnit test project.
First create two classes Customer and Order and ...

There are two steps in configure NUnit project environment:
Configure Project with NUnit assemblies
Setup TestRunners which show the results of NUnit test cases
Configure Project with NUnit assemblies
We always creates separate project when creating project for NUnit. According to naming conventions test project name should be [Project Under Test].[Tests]. For e...

NUnit is most popular tool for doing Unit Testing. Before start, we need to learn what is Unit Testing and why NUnit is a popular tool for doing unit testing.
Unit Testing
Every software is composed of various modules. Each module is composed of various classes. Classes composed of various functions. Function is the smallest unit of code in the application.
When w...