Skip to content

Document MSTEST0047 and the MSTest 4.3 analyzers (MSTEST0064-0068)#54187

Open
Evangelink wants to merge 6 commits into
mainfrom
dev/amauryleve/mstest-analyzers-43
Open

Document MSTEST0047 and the MSTest 4.3 analyzers (MSTEST0064-0068)#54187
Evangelink wants to merge 6 commits into
mainfrom
dev/amauryleve/mstest-analyzers-43

Conversation

@Evangelink

@Evangelink Evangelink commented Jun 4, 2026

Copy link
Copy Markdown
Member

Summary

Reviewed all analyzers shipped (and about to ship) by MSTest.Analyzers against the docs in docs/core/testing/mstest-analyzers/ and added reference pages for the six analyzers that have no documentation today.

Rule Category Status Default severity Code fix
MSTEST0047 — Suppress IDE0060 for unused TestContext parameter Suppression Shipped in MSTest 4.2 (currently undocumented) N/A (suppressor) N/A
MSTEST0064 — Prefer async assertion methods Usage Ships in MSTest 4.3 Info No
MSTEST0065 — Avoid Assert.AreEqual on collection types Usage Ships in MSTest 4.3 Warning No
MSTEST0066[Ignore] should specify a justification Design Ships in MSTest 4.3 Info No
MSTEST0067 — Avoid Thread.Sleep/Task.Wait/Task<T>.Result in test code Usage Ships in MSTest 4.3 Info, disabled by default (auto-enabled in All analysis mode) No
MSTEST0068 — Use Assert instead of CollectionAssert Usage Ships in MSTest 4.3 Info Yes

Source-of-truth verification:

Changes

  • Six new reference pages under docs/core/testing/mstest-analyzers/.
  • Updated overview.md: "All rules" table now has rows for the new analyzers; "Rules by concept" lists the new analyzers under their relevant sections (Assertions, Async/await patterns, Lifecycle & initialization).
  • Updated usage-rules.md, design-rules.md, suppression-rules.md: tables and "Common scenarios" subsections now reference the new analyzers.
  • Updated docs/navigate/devops-testing/toc.yml so the new pages appear in the testing TOC.

Content sourced from

  • Verbatim/adapted from microsoft/testfx:
    • Analyzer .cs files (severity/category/enabled-by-default).
    • Resources.resx (titles and descriptions).
    • CollectionAssertToAssertAnalyzer.cs XML doc remarks (used for the mapping table in MSTEST0068).
  • Newly generated by AI (with verification against the source):
    • "Cause", "Rule description", code samples, "How to fix violations", and "When to suppress warnings" sections for each new analyzer.

All new pages are flagged with ai-usage: ai-assisted per repo guidelines.

Out-of-scope follow-ups identified during the review

These came up during the audit but aren't covered in this PR to keep the scope focused:

  • microsoft-testing-platform-cli-options.md is missing the --show-stdout and --show-stderr options that shipped in MTP 2.2.1.
  • The Microsoft.Testing.Extensions.AzureDevOpsReport extension is mentioned in microsoft-testing-platform-test-reports.md and unit-testing-mstest-sdk.md but has no dedicated overview/usage page.
  • The alpha extensions Microsoft.Testing.Platform.AI and Microsoft.Testing.Extensions.AzureFoundry aren't referenced anywhere in docs/core/testing/; once they exit alpha they'll need their own pages.

Validation

  • npx markdownlint-cli2 passes on all changed and new files.
  • TOC updated alphabetically/numerically to match existing convention.

ai-usage: ai-assisted


Internal previews

Toggle expand/collapse
📄 File 🔗 Preview link
docs/core/testing/mstest-analyzers/design-rules.md MSTest design rules
docs/core/testing/mstest-analyzers/mstest0047.md MSTEST0047: Unused TestContext parameter suppressor
docs/core/testing/mstest-analyzers/mstest0064.md "MSTEST0064: Prefer async assertion methods"
docs/core/testing/mstest-analyzers/mstest0065.md MSTEST0065: Avoid Assert.AreEqual on collection types
docs/core/testing/mstest-analyzers/mstest0066.md docs/core/testing/mstest-analyzers/mstest0066
docs/core/testing/mstest-analyzers/mstest0067.md MSTEST0067: Avoid synchronously blocking calls in test code
docs/core/testing/mstest-analyzers/mstest0068.md "MSTEST0068: Use Assert instead of CollectionAssert"
docs/core/testing/mstest-analyzers/overview.md MSTest code analysis
docs/core/testing/mstest-analyzers/suppression-rules.md MSTest suppression rules
docs/core/testing/mstest-analyzers/usage-rules.md docs/core/testing/mstest-analyzers/usage-rules
docs/navigate/devops-testing/toc.yml docs/navigate/devops-testing/toc

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants