Add secret name validator coverage - #7745
sfmskywalker wants to merge 4 commits into
Conversation
There was a problem hiding this comment.
Pull request overview
Adds focused unit tests for DefaultSecretNameValidator to exercise expected valid/invalid name handling, trimming behavior, maximum length enforcement, and normalization behavior within the Elsa Secrets module.
Changes:
- Introduces unit tests covering valid and invalid secret name formats and required-name behavior.
- Adds coverage for trimming behavior during validation.
- Adds coverage for name normalization (trim + lowercase).
| [Fact] | ||
| public void IsValid_RejectsNamesLongerThanTwoHundredCharacters() | ||
| { | ||
| var name = $"a{new string('b', 200)}"; | ||
|
|
||
| var isValid = _validator.IsValid(name, out var error); | ||
|
|
||
| Assert.False(isValid); | ||
| Assert.NotNull(error); | ||
| } |
Greptile SummaryAdds direct unit coverage for Confidence Score: 5/5The change is limited to unit test coverage for the secret name validator and does not modify production behavior. The touched file adds focused tests for validation outcomes, trimming, length handling, and normalization paths described by the change.
What T-Rex did
Reviews (3): Last reviewed commit: "Merge branch 'main' into codex/increase-..." | Re-trigger Greptile |
|
Handled Copilot inline comment #7745 (comment). Direct inline reply failed with GitHub API 404, so replying here instead: addressed in 3a70511 by asserting both the accepted 200-character boundary and rejected 201-character boundary. Validated with |
|
Follow-up for Copilot inline comment #7745 (comment): also addressed the exact error-message assertion in 4a7abf3. The boundary test now accepts 200 characters, rejects 201 characters, and asserts the shared format error. Validation: |
Summary
Tests