Skip to content

Conversation

@Evangelink
Copy link
Member

@Evangelink Evangelink commented Jan 8, 2026

Copilot AI review requested due to automatic review settings January 8, 2026 11:16
@dotnetrepoman dotnetrepoman bot added this to the January 2026 milestone Jan 8, 2026
Copy link
Contributor

Copilot AI left a comment

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 enhances the MSTest attributes documentation by adding comprehensive coverage of previously undocumented attributes and APIs. The changes focus on data-driven testing features, test lifecycle management, threading models, conditional execution, and test control mechanisms.

Key changes include:

  • Addition of DiscoverInternalsAttribute documentation for discovering internal test classes and methods.
  • Comprehensive documentation of data-driven testing features including DynamicDataAttribute, TestDataRow, and UnfoldingStrategy.
  • Documentation of global test lifecycle attributes (GlobalTestInitialize and GlobalTestCleanup).
  • Reorganization of test execution control attributes with new sections for threading, parallelization, timeout/retry, and conditional execution attributes.
Comments suppressed due to low confidence (5)

docs/core/testing/unit-testing-mstest-writing-tests-attributes.md:415

  • This list is missing Oxford commas. The style guidelines require Oxford commas in all lists. Add commas before "and" in items where multiple concepts are joined.
- <xref:Microsoft.VisualStudio.TestTools.UnitTesting.UnfoldingStrategy.Auto?displayProperty=nameWithType> (default): MSTest automatically determines whether to unfold test cases based on the number of data rows. Test cases are collapsed (folded) when there are many data rows to avoid cluttering Test Explorer, and unfolded when there are few data rows for better visibility.
- <xref:Microsoft.VisualStudio.TestTools.UnitTesting.UnfoldingStrategy.Unfold?displayProperty=nameWithType>: All test cases are expanded and shown individually in Test Explorer and TRX results. Each test case can be run independently.
- <xref:Microsoft.VisualStudio.TestTools.UnitTesting.UnfoldingStrategy.Fold?displayProperty=nameWithType>: Test cases are collapsed into a single test node. Individual test cases cannot be run independently; the entire data-driven test runs as one unit.

docs/core/testing/unit-testing-mstest-writing-tests-attributes.md:378

  • The list is missing an Oxford comma. Add a comma before "and" in the last item to comply with the Markdown writing style guidelines requiring Oxford commas in all lists.
- **Custom display names**: Set a unique display name for each test case using the <xref:Microsoft.VisualStudio.TestTools.UnitTesting.TestDataRow.DisplayName> property
- **Test properties**: Attach metadata to individual test cases using the <xref:Microsoft.VisualStudio.TestTools.UnitTesting.TestDataRow.TestProperties> property
- **Type-safe data**: Use the generic `TestDataRow<T>` to provide strongly-typed test data

docs/core/testing/unit-testing-mstest-writing-tests-attributes.md:639

  • The list is missing an Oxford comma. Add a comma before "and a delay backoff type" to comply with the Markdown writing style guidelines requiring Oxford commas in all lists.
The [Retry](xref:Microsoft.VisualStudio.TestTools.UnitTesting.RetryAttribute) attribute was introduced in MSTest 3.8. This attribute causes the test method to be retried when it fails or timeouts. It allows you to specify the maximum number of retry attempts, the time delay between retries, and a delay backoff type, which is either constant or exponential.

docs/core/testing/unit-testing-mstest-writing-tests-attributes.md:705

  • Add a comma after "for example" to properly set off this introductory phrase.
You can specify which operating systems the test supports or doesn't support using the [OperatingSystems](xref:Microsoft.VisualStudio.TestTools.UnitTesting.OperatingSystems) flags enum, which includes `Windows`, `Linux`, `OSX` (macOS), and `FreeBSD`. You can combine multiple operating systems using the bitwise OR operator.

docs/core/testing/unit-testing-mstest-writing-tests-attributes.md:378

  • According to the Markdown writing style guidelines, list items should be complete sentences with proper punctuation. The benefit descriptions on lines 376-378 are sentence fragments without ending punctuation. Add periods at the end of each item to make them complete sentences.
- **Custom display names**: Set a unique display name for each test case using the <xref:Microsoft.VisualStudio.TestTools.UnitTesting.TestDataRow.DisplayName> property
- **Test properties**: Attach metadata to individual test cases using the <xref:Microsoft.VisualStudio.TestTools.UnitTesting.TestDataRow.TestProperties> property
- **Type-safe data**: Use the generic `TestDataRow<T>` to provide strongly-typed test data

### `ParallelizeAttribute`
#### `UITestMethodAttribute`

When applied to a test method, the `UITestMethod` attribute indicates that the test method should be scheduled on the UI thread of the platform. This attribute is specifically designed for testing UWP (Universal Windows Platform) and WinUI applications that require UI thread access.
Copy link

Copilot AI Jan 8, 2026

Choose a reason for hiding this comment

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

The UITestMethod attribute is not referenced with an xref cross-reference like other attributes in the document. For consistency with the rest of the document and to provide proper linking, this should be [UITestMethod](xref:Microsoft.VisualStudio.TestTools.UnitTesting.UITestMethodAttribute) or similar.

Copilot uses AI. Check for mistakes.
Copy link
Member Author

Choose a reason for hiding this comment

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

For some reason the API doc related to this attribute doesn't exist. @Youssef1313 is it because the attribute is not present in all TFMs?

@Evangelink
Copy link
Member Author

@Youssef1313 @meaghanlewis working on this doc page, I feel like the attribute grouping is too technical and it would probably be better to have something like:

  1. Overview (basics + getting started)
  2. Data-Driven Testing (keep separate - it's substantial)
  3. Test Lifecycle & Setup (fixtures)
  4. Test Execution & Control (threading, parallelization, timeout, retry, conditional execution combined)
  5. Metadata & Organization (all metadata attributes)

Copy link
Contributor

Copilot AI commented Jan 8, 2026

@Evangelink I've opened a new pull request, #50980, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Jan 8, 2026

@Evangelink I've opened a new pull request, #50981, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Jan 8, 2026

@Evangelink I've opened a new pull request, #50982, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Jan 8, 2026

@Evangelink I've opened a new pull request, #50983, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Jan 8, 2026

@Evangelink I've opened a new pull request, #50984, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link
Contributor

Copilot AI commented Jan 8, 2026

@Evangelink I've opened a new pull request, #50985, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 6 commits January 8, 2026 12:30
* Initial plan

* Fix ambiguous contraction in TestPropertyAttribute documentation

Co-authored-by: Evangelink <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Evangelink <[email protected]>
#50982)

* Initial plan

* Change 'may take' to 'might take' for style compliance

Co-authored-by: Evangelink <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Evangelink <[email protected]>
* Initial plan

* Add periods to list items per style guide

Co-authored-by: Evangelink <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Evangelink <[email protected]>
…50981)

* Initial plan

* Add missing using System.Reflection directive to DynamicDataDisplayName example

Co-authored-by: Evangelink <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Evangelink <[email protected]>
* Initial plan

* Add missing comma after "for example" on line 450

Co-authored-by: Evangelink <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Evangelink <[email protected]>
* Initial plan

* Add missing Oxford commas and list punctuation

Co-authored-by: Evangelink <[email protected]>

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: Evangelink <[email protected]>
Co-authored-by: Amaury Levé <[email protected]>
@Evangelink Evangelink enabled auto-merge (squash) January 8, 2026 14:16
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.

2 participants