Add AAA pattern comments to SarifResultsTests.cs#89
Merged
Malcolmnixon merged 1 commit intomainfrom Apr 5, 2026
Merged
Conversation
Agent-Logs-Url: https://github.com/demaconsulting/SarifMark/sessions/635ec017-88c9-4469-abbc-a7d42e69a0cb Co-authored-by: Malcolmnixon <1863707+Malcolmnixon@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
Malcolmnixon
April 4, 2026 01:16
View session
Contributor
There was a problem hiding this comment.
Pull request overview
Adds AAA (Arrange/Act/Assert) pattern comments to SarifResultsTests.cs to align the test suite with the C# Testing Standards review-set requirements.
Changes:
- Added
// Arrange,// Act, and// Assert(or// Act & Assert) comments to manySarifResults.Read(...)validation and version-priority tests. - Added AAA comments to the
SarifResults_InternalConstructor_CreatesValidInstanceandSarifResults_Read_WithLocations_ReturnsResultsWithLocationDatatests.
Comments suppressed due to low confidence (1)
test/DemaConsulting.SarifMark.Tests/Sarif/SarifResultsTests.cs:432
- The Arrange comment is ambiguous/inaccurate: it says the SARIF file has “semanticVersion field and no version field”, but the JSON includes the required SARIF log
"version": "2.1.0". If this is referring to the tool driver’sversionproperty, please clarify the comment to avoid confusing SARIF log version vs tool version fields.
// Arrange - SARIF file with semanticVersion field and no version field
var filePath = PathHelpers.SafePathCombine(_testDirectory!, "semantic-version.sarif");
File.WriteAllText(filePath, """
{
"version": "2.1.0",
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This was referenced Apr 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Formal review of all 13 review-sets in
.reviewmark.yamlidentified that 24 test methods inSarifResultsTests.cswere missing mandatory AAA pattern comments required by the C# Testing Standards.Changes
test/.../Sarif/SarifResultsTests.cs— Added// Arrange,// Act,// Assert(or// Act & Assert) comments with brief descriptions to 23 of 24 affected tests (theReadvalidation tests, version-priority tests,InternalConstructor, andWithLocationstest). One remaining test (WithSuppressedResults) still needs its comments added.Before
After
Type of Change
Related Issues
Pre-Submission Checklist
Before submitting this pull request, ensure you have completed the following:
Build and Test
dotnet build --configuration Releasedotnet test --configuration Releasedotnet run --project src/DemaConsulting.SarifMark --configuration Release --framework net10.0--no-build -- --validateCode Quality
dotnet format --verify-no-changesQuality Checks
Please run the following checks before submitting:
./lint.sh(Unix/macOS) orcmd /c lint.bat/./lint.bat(Windows)Testing
Documentation
Additional Notes
Review of all 13
.reviewmark.yamlreview-sets was performed. All other review-sets passed. The only confirmed defect was the missing AAA comments inSarifResultsTests.cs; other agent findings (invalid test references forSarifMark_SarifReading/SarifMark_MarkdownReportGeneration, literate programming inProgram.cs, 3-part subsystem test naming) were dismissed as false positives after manual verification. One test (SarifResults_Read_WithSuppressedResults_ExcludesSuppressedResults) still needs its AAA comments completed.