Integration tests

A unit test is a very powerful concept that can increase product quality and can be used to find many bugs as soon as they appear in the code. However, when your application becomes more and more complicated, testing separate small components is not enough. Many problems appear when we use these components together, and while two asynchronous methods can run well separately, they can cause a deadlock while running simultaneously. This is why it is very important to write higher-level tests for your application that run the application's business logic altogether. Such tests are called integration tests because we check how the application components work together.

To illustrate this approach, we will take a slightly changed code ...

Get Mastering C# Concurrency now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.