In unit tests, assertions inside if-clauses risks being silently skipped. We discuss some tips and best practices in 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 ;)