Skip to content

Improve That property XML docs: fix broken link, add inline examples (fixes #8818)#8822

Merged
Evangelink merged 2 commits into
microsoft:mainfrom
Evangelink:dev/amauryleve/that-docs-xref
Jun 4, 2026
Merged

Improve That property XML docs: fix broken link, add inline examples (fixes #8818)#8822
Evangelink merged 2 commits into
microsoft:mainfrom
Evangelink:dev/amauryleve/that-docs-xref

Conversation

@Evangelink

@Evangelink Evangelink commented Jun 4, 2026

Copy link
Copy Markdown
Member

Description

Addresses #8818 by overhauling the <remarks> of the That singleton properties on Assert, StringAssert, and CollectionAssert:

  1. Fix the broken link. Replace the 404 https://github.com/Microsoft/testfx/docs/README.md with deep links into the new dotnet/docs MSTest assertions guide:
  2. Add inline <example> blocks so the in-IntelliSense info is no longer "very limited". Each example is a complete, copy-pasteable demo of the extension-method pattern:
    • Assert.ThatIsPrime extension method
    • StringAssert.ThatContainsWords extension method
    • CollectionAssert.ThatAreEqualUnordered extension method
  3. Recommend extending Assert.That for new custom assertions on the StringAssert.That / CollectionAssert.That remarks, since those classes are likely to be deprecated.
  4. Use proper XML doc tags: <c> for inline code, <see href="..."> for external links, <see cref="..."/> for cross-references, <para> for multi-paragraph remarks, and <example>/<code language="csharp"> for samples.

Related

Verification

build.cmd -projects src/TestFramework/TestFramework/TestFramework.csproj -configuration DebugBuild succeeded, 0 Warning(s), 0 Error(s).

Replaces the broken testfx README link in the <remarks> of Assert.That, StringAssert.That, and CollectionAssert.That with deep links to the new MSTest assertions documentation:

- Assert.That -> 'Create custom assertions with Assert.That' section
- StringAssert.That / CollectionAssert.That -> 'Extension hooks on StringAssert and CollectionAssert' subsection

Also clarifies that for new custom assertions, users should extend Assert.That rather than the StringAssert.That / CollectionAssert.That hooks, since StringAssert and CollectionAssert are likely to be deprecated.

Related: dotnet/docs#54185

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings June 4, 2026 13:49

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates the XML documentation (<remarks>) for the That singleton properties on MSTest’s Assert, StringAssert, and CollectionAssert to replace a broken repo link with deep links into the Microsoft Learn “MSTest assertions” guide, and to improve the structure/formatting of the remarks using appropriate XML doc tags.

Changes:

  • Replaces the dead github.com/Microsoft/testfx/docs/README.md reference with Microsoft Learn deep links for Assert.That, StringAssert.That, and CollectionAssert.That.
  • Improves XML doc formatting by using <c> for inline code and <para> blocks for multi-paragraph remarks (String/Collection).
  • Adds guidance text steering new extensibility towards Assert.That (with wording adjustments needed; see review comments).
Show a summary per file
File Description
src/TestFramework/TestFramework/Assertions/StringAssert.cs Updates StringAssert.That remarks: structured paragraphs, inline code formatting, and new Microsoft Learn link.
src/TestFramework/TestFramework/Assertions/CollectionAssert.cs Updates CollectionAssert.That remarks: structured paragraphs, inline code formatting, and new Microsoft Learn link.
src/TestFramework/TestFramework/Assertions/Assert.cs Updates Assert.That remarks: inline code formatting and new Microsoft Learn link.

Copilot's findings

  • Files reviewed: 3/3 changed files
  • Comments generated: 2

Comment thread src/TestFramework/TestFramework/Assertions/StringAssert.cs
Comment thread src/TestFramework/TestFramework/Assertions/CollectionAssert.cs
Issue microsoft#8818 reported two problems: the broken link AND limited in-place info on how to use the property. The previous commit fixed the link; this commit addresses the second part by adding copy-pasteable <example> code blocks to each That property:

- Assert.That -> IsPrime extension method
- StringAssert.That -> ContainsWords extension method
- CollectionAssert.That -> AreEqualUnordered extension method

These examples surface directly in IntelliSense, so developers can see complete usage without leaving their IDE.

Closes microsoft#8818

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@Evangelink Evangelink changed the title Link That property docs to the new MSTest assertions guide Improve That property XML docs: fix broken link, add inline examples (fixes #8818) Jun 4, 2026
@Evangelink Evangelink enabled auto-merge (squash) June 4, 2026 16:44
@Evangelink Evangelink merged commit 8e77e70 into microsoft:main Jun 4, 2026
40 checks passed
@Evangelink Evangelink deleted the dev/amauryleve/that-docs-xref branch June 4, 2026 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link "More documentation is at "https://github.com/Microsoft/testfx/docs/README.md"" is broken

3 participants