Latest from the blog
How to Unit Test an Abstract Class
How to unit test an abstract class? Or a whole class hierarchy that depends on that abstract class? Let’s see.
DRY vs DAMP in Unit Tests
In this post, we’ll make a deep dive into the DRY and DAMP principles and will talk about the false dichotomy around them.
How to Strengthen Requirements for Pre-existing Data
Need to change validation rules but have pre-existing data that doesn’t follow the new rules? In this post, we’ll talk about how to do that properly.
When to Mock
The use of mocks in unit testing is a controversial topic (maybe less so now than several years ago). I remember how, throughout my programming career, I went from mocking almost every dependency, to the "no-mocks" policy, and then to "only mock external dependencies".
None of this practices are good enough. In this article, I’ll show you which dependencies to mock, and which to use as is in your tests.
Unit Testing Dependencies: The Complete Guide
In this article, we’ll review the types of unit testing dependencies. This is more of a reference article, to which I’ll be referring in future posts. Still, this topic is important for establishing the common vocabulary.