public void GetReadChannelSourceAsync_should_fork_the_channelSource()
        {
            var subject = new ChannelSourceReadWriteBinding(_channelSource, ReadPreference.Primary);

            subject.GetReadChannelSourceAsync(CancellationToken.None);

            _channelSource.Received().Fork();
        }
コード例 #2
0
        public void GetReadChannelSource_should_fork_the_channelSource(
            [Values(false, true)]
            bool async)
        {
            var subject = new ChannelSourceReadWriteBinding(_channelSource, ReadPreference.Primary);

            if (async)
            {
                subject.GetReadChannelSourceAsync(CancellationToken.None).GetAwaiter().GetResult();
            }
            else
            {
                subject.GetReadChannelSource(CancellationToken.None);
            }

            _channelSource.Received().Fork();
        }