In unit tests, assertions inside if-clauses risk being silently skipped. We discuss some tips and best practices to avoid situations where assertions live in if-clauses.
Generally, it is inadvisable to directly expect in if-clauses. Here are some tips to avoid these situations.
The post talks about how to avoid ifs ;)