public async Task AsyncEnumerableAsyncDisposable() { var target = new AsyncDisposableTarget(); await Verifier.Verify(AsyncEnumerableAsyncDisposableMethod(target)); Assert.True(target.AsyncDisposed); }
public async Task TaskResultAsyncDisposable() { var disposableTarget = new AsyncDisposableTarget(); var target = Task.FromResult(disposableTarget); await Verifier.Verify(target); Assert.True(disposableTarget.AsyncDisposed); }
static async IAsyncEnumerable <AsyncDisposableTarget> AsyncEnumerableAsyncDisposableMethod(AsyncDisposableTarget target) { await Task.Delay(1); yield return(target); }