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); }
public void UnsafeOnCompleted(Action continuation) => _taskAwaiter.UnsafeOnCompleted(WrapContinuation(continuation));
void ICriticalNotifyCompletion.UnsafeOnCompleted(Action continuation) => _cfgAwaiter.UnsafeOnCompleted(continuation);