Integration Testing with Docker

Running Integration Tests with Docker in .NET using TestContainers

Hello everyone, in today’s post I will show you the easiest and cleanest way to perform integration testing of your code with database dependencies with the help of docker and TestContainers. Unlike unit tests where you can use In-Memory or Mock the database calls, integration tests need to test the actual calls to the database, and using an empty, In-Memory, database will not represent the reality of what the system is doing, or perhaps your code is tightly coupled with specific database behaviors or relies on certain configurations that an In-Memory setup won’t capture accurately. For that, we will use docker to run a dockerized database image and perform our tests against it. And for that, we will use TestContainers. ...

November 30, 2023 · 2 min · Mohamad Dbouk
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