Tag Unit Testing
How to Assert Database State?
Today, we'll discuss a question that relates to my Unit Testing book: how to assert the state of the database?
Domain model purity and lazy loading
This is the final article in the domain model purity series, where we’ll discuss this subject in the context of lazy loading.
Domain model purity and the current time
I’m continuing the topic of domain model purity. This time, we’ll discuss it with regards to getting the current date and time.
Domain model purity vs. domain model completeness (DDD Trilemma)
I’ve been meaning to write this article for a long time and, finally, here it is: the topic of domain model purity versus domain model completeness.
Is Equality Comparison a Code Pollution?
This post is about where to put the equality comparison logic: under the test or production code.
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.
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.