public async Task TestOutputAvailableAsync_DataAfterCompletion() { foreach (bool withUncanceledToken in DataflowTestHelpers.BooleanValues) foreach (bool withData in DataflowTestHelpers.BooleanValues) { var wob = new WriteOnceBlock<int>(_ => _); if (withData) wob.Post(42); else wob.Complete(); await wob.Completion; Task<bool> t = withUncanceledToken ? wob.OutputAvailableAsync(new CancellationTokenSource().Token) : wob.OutputAvailableAsync(); Assert.Equal(expected: withData, actual: await t); } }