Integration Testing and Minimal API in .Net 7

Say Hello to Reliable Minimal APIs with Integration Tests

Hi there! Integration testing is an important part of the software development process because it helps ensure that your APIs are working correctly and returning the expected result. Unfortunately, many people often mix up integration tests with mock testing and use mock for integration tests. This can lead to issues when testing APIs, as mock tests don’t provide a complete picture of how your code will behave in a real-world scenario. ...

January 8, 2023 · 7 min · Mohamad Dbouk
NSubstitute Logo

How to Mock using NSubstitute

Unit tests are code written to test small pieces of functionality of big programs. Performing unit tests is always designed to be simple, A “UNIT” in this sense is the smallest component of the large code part that makes sense to test, mainly a method out of many methods of some class. Unit tests take milliseconds, can be run at the press of a button, and don’t necessarily require any knowledge of the system at large. And when writing unit tests, you need to focus on the UNIT at hand and not consider other dependencies like services or variables. To accomplish that we need to use mocking. There are many Mocking frameworks out there, but today we will check NSubstitute. ...

November 4, 2022 · 2 min · Mohamad Dbouk