microsoft / sarif-pattern-matcher

Quality domain agnostic regular expression pattern matcher that persists results to SARIF
MIT License
39 stars 18 forks source link

Added reflection Tests invariant testing functions #646

Closed HulonJenkins closed 2 years ago

HulonJenkins commented 2 years ago

Changes

Added 2 invariant functions to ReflectionTests.cs that check if

  1. All rules in a Json rules definition file have valid shared strings
  2. All Validators in an assembly have corresponding Tests
michaelcfanning commented 2 years ago
public class ReflectionTests

You didn't create it but this is a bad name.

If describes the mechanism utilized in the tests but not the purpose of the tests.

This is a common mistake, people encode the how of doing something as opposed to the why (which is more important for maintainability).


Refers to: Src/Test.UnitTests.Sarif.PatternMatcher/ReflectionTests.cs:16 in 7d51136. [](commit_id = 7d51136b47ee0bb7e2ae2bf4143268393eb3215c, deletion_comment = False)