One Assert Per Test - OAPT
One assertion per test
is a wise rule to keep in mind, because it helps you have tests that fail for a specific reason, and drives you to focus on a specific behavior at a time.
Having multiple assertions means that a test can fail for multiple reasons, which makes it harder to determine the cause of failure.
Oapt saves you this trouble by running your unit tests several times, each time using one assert and ignoring the rest.
I think it’s a good idea, especially it can save a lot of trouble.
My site is free of ads and trackers. Was this post helpful to you? Why not
Disqus is great for comments/feedback but I had no idea it came with these gaudy ads.