Are multiple asserts bad in a unit test? Even if chaining?

As others have pointed out, it’s best to stick with one assert in each test in order to avoid losing information – if the first assert fails, you don’t know whether the later ones would fail also. You have to fix the problem with less information – which might (probably will) be harder.

A very good reference is Roy Osherove’s Art of Unit Testing – if you want to get started right with Unit Testing, you could do a lot worse than starting here.

Leave a Comment