Add MSTest DeploymentItem sub-page#54210
Open
Evangelink wants to merge 2 commits into
Open
Conversation
Adds a new `Write tests` sub-page that documents `DeploymentItemAttribute` end to end: how it resolves relative paths against the build output directory, the two constructor overloads, how to stage source files via `CopyToOutputDirectory` or post-build events, `TestContext.DeploymentDirectory`, `DeploymentEnabled`, legacy mode caveats, and best practices. Cross-links the new page from the main Write tests page (description table + attribute quick reference) and the TestContext page, and wires the entry into devops-testing/toc.yml. Related to microsoft/testfx#8960 (the matching XML doc comment fix on the attribute is microsoft/testfx#8968). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a dedicated MSTest “Write tests” sub-page that documents DeploymentItemAttribute, and wires the new page into the existing MSTest documentation via navigation and cross-links.
Changes:
- Adds a new article that explains how
DeploymentItemAttributeresolves paths, deploys files/folders, and interacts withTestContext.DeploymentDirectory. - Updates the MSTest “Write tests” hub page to include the new topic in the topic table and attribute quick reference.
- Updates the
TestContextpage and the DevOps testing TOC to link to the new content.
Show a summary per file
| File | Description |
|---|---|
| docs/navigate/devops-testing/toc.yml | Adds “Deployment items” under MSTest “Writing tests” navigation. |
| docs/core/testing/unit-testing-mstest-writing-tests.md | Adds the new “Deployment items” topic and an attribute quick-reference row. |
| docs/core/testing/unit-testing-mstest-writing-tests-testcontext.md | Cross-links DeploymentDirectory to the new DeploymentItem article. |
| docs/core/testing/unit-testing-mstest-writing-tests-deployment-items.md | New page documenting DeploymentItemAttribute usage, configuration, and best practices. |
Copilot's findings
- Files reviewed: 4/4 changed files
- Comments generated: 7
- Add missing 'using System.IO;' to the two snippets that use File/Path. - Drop trailing backslash from verbatim folder paths (@"TestFiles\" and @"Resources\") since C# verbatim string literals can't end with a single backslash. - Rename 'Use a post-build event' section to 'Use a post-build target' to match the MSBuild <Target> example. Addresses review comments on PR dotnet#54210. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Adds a dedicated MSTest
Write testssub-page for theDeploymentItemAttribute. Pairs with microsoft/testfx#8968, which fixes the XML doc comment on the attribute itself (both address microsoft/testfx#8960).New page
docs/core/testing/unit-testing-mstest-writing-tests-deployment-items.mdcovers:RunConfig.RelativePathRoot.DeploymentItemAttributeconstructor overloads with realistic examples (single file, file with subfolder, folder).<None>/<Content>+CopyToOutputDirectoryor a post-build target.TestContext.DeploymentDirectoryat run time.<DeploymentEnabled>False</DeploymentEnabled>..testsettings/ForcedLegacyMode) caveats around relative-path resolution.CopyToOutputDirectory, keep items small, deploy folders, etc.).Touch-ups in existing pages
unit-testing-mstest-writing-tests.md— added the new page to the topic-overview table and the attribute-quick-reference table (new "Test resources" row forDeploymentItem).unit-testing-mstest-writing-tests-testcontext.md— cross-linked theDeploymentDirectorybullet to the new page.docs/navigate/devops-testing/toc.yml— added the new page under the MSTest "Write tests" group.Notes
ai-usage: ai-assistedfront matter set.markdownlint-cli2passes on the new page and the three edited pages.cc @Evangelink