-
Notifications
You must be signed in to change notification settings - Fork 6.1k
Update MSTest v4 migration documentation #50543
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Updated the date for MSTest v4 migration and added information about accessing non-existing properties in TestContext.Properties.
There was a problem hiding this 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 updates the MSTest v4 migration documentation to reflect the current date and adds important information about a breaking change in how TestContext.Properties handles non-existent properties. The update addresses a behavioral change where accessing a non-existent property now throws KeyNotFoundException instead of returning null.
Key changes:
- Updated the document date from 07/22/2025 to 12/11/2025
- Added new subsection documenting the breaking change for accessing non-existent properties in
TestContext.Properties - Included code examples showing the behavior difference between MSTest 3.x and 4.x
|
|
||
| #### Accessing non-existing property | ||
|
|
||
| Accessing a non-existing property in the dictionary will now throw `KeyNotFoundException` rather than returning null. |
Copilot
AI
Dec 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider simplifying this sentence to be more conversational and concise. Instead of "Accessing a non-existing property in the dictionary will now throw", consider "Accessing a non-existent property in the dictionary now throws" (using present tense instead of future tense with "will", and "non-existent" is the more common spelling).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
| var value = TestContext.Properties["NonExistent"]; // Throws KeyNotFoundException | ||
| ``` | ||
|
|
||
| To check for existence of a property, use `TryGetValue` or `ContainsKey` methods. |
Copilot
AI
Dec 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider simplifying this sentence to be more direct and conversational. Instead of "To check for existence of a property", consider "To check if a property exists" for clearer, more natural phrasing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
|
|
||
| Previously, `TestContext.Properties` was an `IDictionary`. To provide better typing, it's now `IDictionary<string, object>`. | ||
|
|
||
| #### Accessing non-existing property |
Copilot
AI
Dec 11, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The heading uses a gerund "Accessing", which should be avoided in titles. Consider changing this to a noun-based heading such as "Access to non-existing properties" or "Non-existing property access".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@copilot open a new pull request to apply changes based on this feedback
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.
Updated the date for MSTest v4 migration and added information about accessing non-existing properties in TestContext.Properties.
Related microsoft/testfx#6952
Internal previews