November 2024
Intermediate to advanced
300 pages
7h 12m
English
While assertEquals and assertTrue would cover almost all the assertions you’ll need to write, you’ll want to learn about the other forms that JUnit supports. Choosing the best assertion for the job will keep your tests concise and clear.
In this section, you’ll be introduced to the majority of JUnit’s other assertion forms, including assertFalse, assertNotEquals, assertSame, assertNotSame, assertNull, and assertNotNull. You’ll also get an experience-based opinion on the value and best uses for each variant.
Nobody doesn’t dislike double negatives (or triple negatives, so says my editor). To help you say things “straight up” in your tests, JUnit provides some inverse assertions. Here’s assertFalse ...
Read now
Unlock full access