Assertions with comments

Use this rule to ensure all assertions include explanatory comments.

Lorenzo Frattini avatar
Written by Lorenzo Frattini
Updated over a week ago


As a best practice, all assertions should include a comment to describe the rationale or the expected outcome.


  • Apex methods annotated with @isTest

  • Apex methods with the testMethod modifier


  • This rule will not fire for assertion-equivalent methods performed using third party libraries, such as fflib_ApexMocks

Did this answer your question?