Groovy Documentation

groovy.org.codenarc.rule.junit
[Groovy] Class UseAssertFalseInsteadOfNegationRule

java.lang.Object
  org.codenarc.rule.AbstractAstVisitorRule
      groovy.org.codenarc.rule.junit.UseAssertFalseInsteadOfNegationRule

class UseAssertFalseInsteadOfNegationRule
extends AbstractAstVisitorRule

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

Authors:
Hamlet D'Arcy


Property Summary
String applyToClassNames

Class astVisitorClass

String name

int priority

 

Property Detail

applyToClassNames

String applyToClassNames


astVisitorClass

Class astVisitorClass


name

String name


priority

int priority


 

Groovy Documentation