Skip to content
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

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

Copy link
Contributor

@gewarren gewarren left a 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.

Co-authored-by: Genevieve Warren <[email protected]>
@Evangelink
Copy link
Member Author

It would be ideal if you can add the longer code snippets to a project so it's automatically verified to compile.

Could you please provide me with an example?

@gewarren
Copy link
Contributor

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.
Copy link
Member

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.

Copy link
Member Author

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.

Copy link
Member Author

Choose a reason for hiding this comment

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

Suggested something simpler.


# 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.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
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?

@Evangelink
Copy link
Member Author

Ping @IEvangelist

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.

Document TestContext property
4 participants