public void ConfigureAwait_AwaitMoveNextAsync_FlagsSetAppropriately(bool continueOnCapturedContext)
        {
            var enumerable = new TrackFlagsAsyncEnumerable()
            {
                Flags = 0
            };

            ConfiguredAsyncEnumerable <int> .Enumerator enumerator = enumerable.ConfigureAwait(continueOnCapturedContext).GetAsyncEnumerator();
            ConfiguredValueTaskAwaitable <bool> .ConfiguredValueTaskAwaiter moveNextAwaiter = enumerator.MoveNextAsync().GetAwaiter();
            moveNextAwaiter.UnsafeOnCompleted(() => { });
            Assert.Equal(
                continueOnCapturedContext ? ValueTaskSourceOnCompletedFlags.UseSchedulingContext : ValueTaskSourceOnCompletedFlags.None,
                enumerable.Flags);
        }
Ejemplo n.º 2
0
 public void UnsafeOnCompleted(Action continuation) => _taskAwaiter.UnsafeOnCompleted(WrapContinuation(continuation));
Ejemplo n.º 3
0
 void ICriticalNotifyCompletion.UnsafeOnCompleted(Action continuation) => _cfgAwaiter.UnsafeOnCompleted(continuation);