Document more MSTest attributes and APIs#50979
Conversation
There was a problem hiding this comment.
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
DiscoverInternalsAttributedocumentation for discovering internal test classes and methods. - Comprehensive documentation of data-driven testing features including
DynamicDataAttribute,TestDataRow, andUnfoldingStrategy. - Documentation of global test lifecycle attributes (
GlobalTestInitializeandGlobalTestCleanup). - 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
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
|
@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:
|
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@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. |
|
@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. |
|
@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. |
|
@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. |
|
@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. |
|
@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. |
* Initial plan * Fix ambiguous contraction in TestPropertyAttribute documentation Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
#50982) * Initial plan * Change 'may take' to 'might take' for style compliance Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
* Initial plan * Add periods to list items per style guide Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
…50981) * Initial plan * Add missing using System.Reflection directive to DynamicDataDisplayName example Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
* Initial plan * Add missing comma after "for example" on line 450 Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com>
* Initial plan * Add missing Oxford commas and list punctuation Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: Evangelink <11340282+Evangelink@users.noreply.github.com> Co-authored-by: Amaury Levé <amauryleve@microsoft.com>
meaghanlewis
left a comment
There was a problem hiding this comment.
These changes LGTM. I had a handful of suggestions for updated xrefs to use in place of the ones that weren't found. Also, other small language suggestions.
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Meaghan Osagie (Lewis) <mosagie@microsoft.com>
@meaghanlewis @Youssef1313 if you both agree, I'll do a follow-up PR after this one. |
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
|
@meaghanlewis it's complaining that it cannot find the |
Sounds like a plan! |
@Evangelink I had a look and can't figure out why these links aren't found. Maybe these can be left out for now and I can open up an issue to address this later. |
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-attributes.md
Outdated
Show resolved
Hide resolved
Done! Could you please review/approve @meaghanlewis and @Youssef1313 |
cc @Youssef1313
Internal previews