Exemple #1
0
    public async Task AsyncEnumerableAsyncDisposable()
    {
        var target = new AsyncDisposableTarget();
        await Verifier.Verify(AsyncEnumerableAsyncDisposableMethod(target));

        Assert.True(target.AsyncDisposed);
    }
Exemple #2
0
    public async Task TaskResultAsyncDisposable()
    {
        var disposableTarget = new AsyncDisposableTarget();
        var target           = Task.FromResult(disposableTarget);
        await Verifier.Verify(target);

        Assert.True(disposableTarget.AsyncDisposed);
    }
Exemple #3
0
    static async IAsyncEnumerable <AsyncDisposableTarget> AsyncEnumerableAsyncDisposableMethod(AsyncDisposableTarget target)
    {
        await Task.Delay(1);

        yield return(target);
    }