public async Task SlidesWriteTimeoutAfterWriteAvailable()
        {
            var sut = new BufferedChannel <int>(1, Timeout50Ms);

            sut.TryWrite(1).ShouldBe(true);
            await Task.Delay(Timeout10Ms).ConfigureAwait(false);

            sut.TryRead(out _).ShouldBe(true);
            await Task.Delay(Timeout100Ms).ConfigureAwait(false);

            sut.Out.Completion.IsCompleted.ShouldBeFalse();
            Should.NotThrow(() => sut.WriteAsync(1), Timeout1Sec);
            await Task.Delay(Timeout10Ms).ConfigureAwait(false);

            sut.TryRead(out _).ShouldBe(true);
        }
        public void TerminatesOnWriteTimeout()
        {
            var sut = new BufferedChannel <int>(1, Timeout100Ms);

            Should.NotThrow(sut.WriteAsync(1), Timeout1Sec);
            sut.TryWrite(1).ShouldBe(false);
            Should.Throw <ChannelWriteTimeoutException>(sut.WaitWriteAvailableAsync(), Timeout1Sec);
            Should.Throw <ChannelWriteTimeoutException>(sut.Out.Completion, Timeout1Sec);
            sut.TryRead(out _).ShouldBe(true);
            Should.Throw <Exception>(sut.Completion, Timeout1Sec);
        }
        public void WriteAsyncCompletesWhenThereIsBufferSpaceAvailable()
        {
            var sut = new BufferedChannel <int>(1);

            Should.CompleteIn(sut.WriteAsync(1), Timeout1Sec);
            var writeTask = sut.WriteAsync(2);

            writeTask.IsCompleted.ShouldBe(false);
            sut.TryRead(out var item).ShouldBe(true);
            item.ShouldBe(1);
            Should.CompleteIn(writeTask, Timeout1Sec);
            sut.TryRead(out item).ShouldBe(true);
            item.ShouldBe(2);
        }