Add test for MSTEST0026 right operand conditional access#10178
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: cd8b0e4d-9508-4e83-bcc7-3112c78255c4
There was a problem hiding this comment.
Pull request overview
Adds targeted MSTEST0026 coverage for conditional access on a binary expression’s right operand.
Changes:
- Tests diagnostics for
Assert.IsTrueandAssert.IsFalse. - Verifies the fix adds one null assertion and removes conditional access.
Show a summary per file
| File | Description |
|---|---|
AssertionArgsShouldAvoidConditionalAccessAnalyzerTests.cs |
Adds right-operand analyzer and code-fix coverage. |
Review details
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Medium
There was a problem hiding this comment.
Note
🤖 Automated review by GitHub Copilot. Generated by the Expert Code Review workflow. To request a follow-up action, reply by tagging @copilot directly.
Review Summary
This PR adds a well-structured test covering the binaryOperation.RightOperand path in HasAnyConditionalAccessOperationChild. Reviewed across all 22 dimensions — no actionable issues found.
| Dimension | Verdict |
|---|---|
| Correctness | ✅ Clean |
| Test Quality | ✅ Clean |
| Naming & Readability | ✅ Clean |
| Assertion Quality | ✅ Clean |
| Coverage Completeness | ✅ Clean |
| Threading | N/A (test-only) |
| Security | N/A |
| Public API | N/A |
| Performance | N/A |
| Backward Compat | N/A |
| Error Handling | N/A |
| Localization | N/A |
| Documentation | ✅ Clean (comment explains intent) |
| Code Style | ✅ Clean |
| Duplication | ✅ Clean |
| Dependencies | N/A |
| Disposal | N/A |
| Nullability | ✅ Clean |
| Platform Compat | N/A |
| Diagnostics/Logging | N/A |
| Serialization | N/A |
| Extensibility | N/A |
Overall: Ship it. The test is correct, well-named, exercises two distinct binary patterns (< and ==), validates both the diagnostic and the code fix, and uses appropriate iteration counts.
🧪 Test quality grade — PR #10178
This advisory comment was generated automatically. Grades are heuristic Warning Firewall blocked 1 domainThe following domain was blocked by the firewall during workflow execution:
network:
allowed:
- defaults
- "awmgmcpg"See Network Configuration for more information.
|
Summary
Assert.IsTrueandAssert.IsFalseTesting
MSTest.Analyzers.UnitTeststest passed onnet8.0Closes #10153