Skip to content

Add AsyncEnumerable support for TestCaseSource, ValueSource, and TestFixtureSource #3043

@jnm2

Description

@jnm2

The .NET Core API proposal for IAsyncDisposable and IAsyncEnumerable is up:
https://github.com/dotnet/corefx/issues/32640

The matching C# 8.0 features foreach async and using async and async iterators will land in a few months.

  • Right now we call IDisposable.Dispose on fixtures. Would we want to recognize and await IAsyncDisposable.DisposeAsync on fixtures?

  • Would we want Assert.That(asyncSequence, Is.EquivalentTo(expectedAsyncSequence)) to light up and just work? I lean towards thinking we should require await AsyncAssert.That( (once we add those APIs) in order to light this one up since it's not an entry point into user code from the framework the way Dispose/DisposeAsync is, and adapting async to sync is an ugly thing for user code work with.

The C# 8 language feature is shape-based, just like the existing async and foreach pattern recognition since C# 5 and 1. We can implement this using reflection without depending on .NET Core or C# 8.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions