Do you suffix unit test classes with "Tests"?

Updated by Brook Jeynes [SSW] 2 years ago. See history

123
<introEmbed body={<> Unit test classes should be suffixed with the word "Tests" for better coding readability. </>} />
[TestFixture] public class SqlValidatorReportTest { }

❌ Figure: Bad example - Unit test class is not suffixed with "Tests"

[TestFixture] public class HtmlDocumentTests { }

✅ Figure: Good example - Unit test class is suffixed with "Tests"

We have a program called SSW Code Auditor to check for this rule.

Acknowledgements

Adam Cogan
Related rules

Need help?

SSW Consulting has over 30 years of experience developing awesome software solutions.

We open source.Loving SSW Rules? Star us on GitHub. Star