Skip to content

Commit d2c3a23

Browse files
Enhance testing conventions with specific examples and diagnostics guidance
Added sub-bullets to testing conventions explaining: - Use concise methods like Single() instead of asserting count and extracting elements - Always validate diagnostics in compiler tests for reviewer clarity Co-authored-by: CyrusNajmabadi <4564579+CyrusNajmabadi@users.noreply.github.com>
1 parent 3dd27c2 commit d2c3a23

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

.github/copilot-instructions.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ var symbolInfo = semanticModel.GetSymbolInfo(expression);
5656
- Add `[WorkItem("https://github.com/dotnet/roslyn/issues/issueNumber")]` attribute to tests that fix specific GitHub issues
5757
- Prefer raw string literals (`"""..."""`) over verbatim strings (`@"..."`) when creating test source code
5858
- Avoid unnecessary intermediary assertions - tests should do the minimal amount of work to validate just the core issue being addressed
59+
- Use concise methods like `.Single()` instead of asserting count and extracting elements
60+
- For compiler tests, validate diagnostics (e.g., `comp.VerifyDiagnostics()`) so reviewers can easily see if the code is in error or represents something legal
5961

6062
## Critical Integration Points
6163

0 commit comments

Comments
 (0)