Introduction One of the most underused features of Moq, is its ability to handle callbacks and custom method implementations. While many developers are familiar with the basic setup and verification…
NUnit’s Coolest Feature – Data-Driven Tests
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,…
Jest: The Comprehensive JavaScript Testing Framework
Introduction Jest is a JavaScript Testing Framework known for its simplicity and ease of use. It is particularly favoured in projects utilising React, Angular, Vue, Node.js, Babel, and TypeScript. This…
Using Jest With TypeScript
Introduction Jest, a popular JavaScript testing framework, has gained immense popularity due to its simplicity, flexibility, and extensive features. It offers a clean and concise syntax for writing unit tests,…