-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
Add documentation about the TestContext #43420
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for adding this. It would be ideal if you can add the longer code snippets to a project so it's automatically verified to compile.
docs/core/testing/unit-testing-mstest-writing-tests-testcontext.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-testcontext.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-testcontext.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-testcontext.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-testcontext.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-testcontext.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-testcontext.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-testcontext.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Genevieve Warren <[email protected]>
Could you please provide me with an example? |
Yes, here is an example that links to a separate code file that's part of a project. You can either reference an entire code file, or a specific "snippet" as defined by "id". You can also highlight certain lines in the snippet using "highlight". Example. |
|
||
# The `TestContext` class | ||
|
||
The <xref:Microsoft.VisualStudio.TestTools.UnitTesting.TestContext> class provides contextual information and support for test execution, making it easier to retrieve information about the test run and manipulate aspects of the environment. It's defined in the <xref:Microsoft.VisualStudio.TestTools.UnitTesting> namespace and is available when using the MSTest Framework. |
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.
This intro is very complicated (for me) to understand. Please try to re-word it in simpler sentences, as if the user has no context about what TestContext is, and tries to understand.
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.
Looking for suggestions here because that's simplest as it can get for me.
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.
Suggested something simpler.
docs/core/testing/unit-testing-mstest-writing-tests-testcontext.md
Outdated
Show resolved
Hide resolved
docs/core/testing/unit-testing-mstest-writing-tests-testcontext.md
Outdated
Show resolved
Hide resolved
Co-authored-by: Jakub Jareš <[email protected]>
|
||
# The `TestContext` class | ||
|
||
The <xref:Microsoft.VisualStudio.TestTools.UnitTesting.TestContext> class provides contextual information and support for test execution, making it easier to retrieve information about the test run and manipulate aspects of the environment. It's defined in the <xref:Microsoft.VisualStudio.TestTools.UnitTesting> namespace and is available when using the MSTest Framework. |
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 <xref:Microsoft.VisualStudio.TestTools.UnitTesting.TestContext> class provides contextual information and support for test execution, making it easier to retrieve information about the test run and manipulate aspects of the environment. It's defined in the <xref:Microsoft.VisualStudio.TestTools.UnitTesting> namespace and is available when using the MSTest Framework. | |
The <xref:Microsoft.VisualStudio.TestTools.UnitTesting.TestContext> class provides access to information about the currently running test, and the environment that surrounds it. It also allows to change some of the aspects of the test environment. It's defined in the <xref:Microsoft.VisualStudio.TestTools.UnitTesting> namespace and is available when using the MSTest Framework. |
maybe?
Ping @IEvangelist |
Fixes microsoft/testfx#4040
Internal previews
TestContext
class