Skip to content

Files

Latest commit

 

History

History
13 lines (7 loc) · 598 Bytes

UseAssertTrueInsteadOfNegation.md

File metadata and controls

13 lines (7 loc) · 598 Bytes

Pattern: assertFalse() with the negation operator

Issue: -

Description

In unit tests, if a condition is expected to be true then there is no sense using assertFalse with the negation operator. For instance, assertFalse(!condition) can always be simplified to assertTrue(condition).

This rule sets the default value of the applyToClassNames property to only match class names ending in 'Test', 'Tests' or 'TestCase'.

Further Reading