Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
]
},
"demaconsulting.buildmark": {
"version": "0.2.0",
"version": "0.3.0",
"commands": [
"buildmark"
]
Expand Down
9 changes: 8 additions & 1 deletion .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@
"words": [
"Anson",
"Blockquotes",
"buildmark",
"BuildMark",
"buildnotes",
"camelcase",
"CodeQL",
"Checkmarx",
"CodeQL",
"copilot",
"cspell",
"csproj",
Expand Down Expand Up @@ -49,9 +51,14 @@
"semver",
"slnx",
"snupkg",
"sonarmark",
"SonarMark",
"SonarQube",
"spdx",
"streetsidesoftware",
"templatetool",
"testname",
"TMPL",
"tracematrix",
"triaging",
"Trivy",
Expand Down
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ root = true
# All files
[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
Expand Down
52 changes: 52 additions & 0 deletions .github/agents/test-developer.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,65 @@ public void ClassName_MethodUnderTest_Scenario_ExpectedBehavior()
- Failure-testing and error handling scenarios
- Verifying internal behavior beyond requirement scope

### Test Source Filters

Test links in `requirements.yaml` can include a source filter prefix to restrict which test results count as
evidence. These filters are critical for platform and framework requirements - **do not remove them**.

- `windows@TestName` - proves the test passed on a Windows platform
- `ubuntu@TestName` - proves the test passed on a Linux (Ubuntu) platform
- `net8.0@TestName` - proves the test passed under the .NET 8 target framework
- `net9.0@TestName` - proves the test passed under the .NET 9 target framework
- `net10.0@TestName` - proves the test passed under the .NET 10 target framework
- `dotnet8.x@TestName` - proves the self-validation test ran on a machine with .NET 8.x runtime
- `dotnet9.x@TestName` - proves the self-validation test ran on a machine with .NET 9.x runtime
- `dotnet10.x@TestName` - proves the self-validation test ran on a machine with .NET 10.x runtime

Removing a source filter means a test result from any environment can satisfy the requirement, which invalidates
the evidence-based proof that the tool works on a specific platform or framework.

### SarifMark-Specific

- **NOT self-validation tests** - those are handled by Software Developer Agent
- Unit tests live in `test/` directory
- Use MSTest V4 testing framework
- Follow existing naming conventions in the test suite

### MSTest V4 Best Practices

Common anti-patterns to avoid (not exhaustive):

1. **Avoid Assertions in Catch Blocks (MSTEST0058)** - Instead of wrapping code in try/catch and asserting in the
catch block, use `Assert.ThrowsExactly<T>()`:

```csharp
var ex = Assert.ThrowsExactly<ArgumentNullException>(() => SomeWork());
Assert.Contains("Some message", ex.Message);
```

2. **Avoid using Assert.IsTrue / Assert.IsFalse for equality checks** - Use `Assert.AreEqual` /
`Assert.AreNotEqual` instead, as it provides better failure messages:

```csharp
// ❌ Bad: Assert.IsTrue(result == expected);
// ✅ Good: Assert.AreEqual(expected, result);
```

3. **Avoid non-public test classes and methods** - Test classes and `[TestMethod]` methods must be `public` or
they will be silently ignored:

```csharp
// ❌ Bad: internal class MyTests
// ✅ Good: public class MyTests
```

4. **Avoid Assert.IsTrue(collection.Count == N)** - Use `Assert.HasCount` for count assertions:

```csharp
// ❌ Bad: Assert.IsTrue(collection.Count == 3);
// ✅ Good: Assert.HasCount(3, collection);
```

## Defer To

- **Requirements Agent**: For test strategy and coverage requirements
Expand Down
Loading