Skip to content

Missing example for async tests with TestContext.CancellationToken #52340

@TiltonJH

Description

@TiltonJH

Type of issue

Missing Example

Description

Hello,

I am trying to resolve warnings concerning MSTEST0049: Flow TestContext cancellation token.

It would be nice if the async test example would show a way to properly get the TestContext within an async test method and then use the CancellationToken of it.

Related to #52341

Page URL

https://learn.microsoft.com/en-us/dotnet/core/testing/unit-testing-mstest-writing-tests

Content source URL

https://github.com/dotnet/docs/blob/main/docs/core/testing/unit-testing-mstest-writing-tests.md

Document Version Independent Id

45a09de0-80af-30d5-6f7d-67d7e9c90faa

Platform Id

5f689c81-41d6-2686-4e53-f62b7c86b50a

Article author

@Evangelink

Metadata

  • ID: 226a7811-aebe-4053-dd68-e222b328bd7c
  • PlatformId: 5f689c81-41d6-2686-4e53-f62b7c86b50a
  • Service: dotnet-fundamentals

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions