Improve That property XML docs: fix broken link, add inline examples (fixes #8818)#8822
Merged
Evangelink merged 2 commits intoJun 4, 2026
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
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.mdreference with Microsoft Learn deep links forAssert.That,StringAssert.That, andCollectionAssert.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
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>
YuliiaKovalova
approved these changes
Jun 4, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Addresses #8818 by overhauling the
<remarks>of theThatsingleton properties onAssert,StringAssert, andCollectionAssert:https://github.com/Microsoft/testfx/docs/README.mdwith deep links into the new dotnet/docs MSTest assertions guide:Assert.That→ Create custom assertions with Assert.ThatStringAssert.That/CollectionAssert.That→ Extension hooks on StringAssert and CollectionAssert<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.That→IsPrimeextension methodStringAssert.That→ContainsWordsextension methodCollectionAssert.That→AreEqualUnorderedextension methodAssert.Thatfor new custom assertions on theStringAssert.That/CollectionAssert.Thatremarks, since those classes are likely to be deprecated.<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 Debug→ Build succeeded, 0 Warning(s), 0 Error(s).