Introduction The single most powerful feature of NUnit, is arguably its extensive support for Data-Driven Tests through attributes like , , and . This feature allows for parameterised tests, enabling…
Using Moq to Verify your Logging is working
Introduction Mocking ILogger<T> for testing methods that use logging in C# can be done effectively using the Moq library. The ILogger<T> interface is commonly used in .NET applications for logging…
NUnit’s Assert.That
Introduction Nunit's Assert.That is a versatile assertion method. It's part of NUnit's constraint-based assert model, which is more flexible and powerful than the traditional assert model. This approach allows for…
Asynchronous Testing with NUnit and C#
Introduction Asynchronous programming has become a cornerstone in modern software development, particularly in C#. Its ability to improve application performance and responsiveness is unparalleled. However, with great power comes great…
Using NUnit to test Exceptions
Introduction Testing exceptions in C# using NUnit is an important aspect of ensuring your application handles error conditions correctly. NUnit provides a concise and expressive syntax for asserting that exceptions…
TDD – Test Driven Development
Introduction Creating a simple calculator class using Test-Driven Development (TDD) in C# involves following the TDD cycle: write a failing test, write just enough code to make the test pass,…
Testing Exceptions in C# with NUnit
Introduction Exceptions are an essential part of any programming language, and they can help to prevent crashes and ensure that code is robust. However, testing exceptions can be a complex…
Unit Testing in C# with NUnit
Introduction Unit testing is a crucial aspect of software development, ensuring the quality and reliability of code. It involves creating small, isolated tests to validate individual components of an application.…