public void GetReadConnectionSourceAsync_should_delegate_to_reference()
        {
            var subject = new ReadWriteBindingHandle(_readWriteBinding);

            subject.GetReadConnectionSourceAsync(Timeout.InfiniteTimeSpan, CancellationToken.None);

            _readWriteBinding.Received().GetReadConnectionSourceAsync(Timeout.InfiniteTimeSpan, CancellationToken.None);
        }
예제 #2
0
        public void GetReadChannelSourceAsync_should_delegate_to_reference()
        {
            var subject = new ReadWriteBindingHandle(_readWriteBinding);

            subject.GetReadChannelSourceAsync(CancellationToken.None);

            _readWriteBinding.Received().GetReadChannelSourceAsync(CancellationToken.None);
        }
        public void GetReadChannelSource_should_delegate_to_reference(
            [Values(false, true)]
            bool async)
        {
            var subject = new ReadWriteBindingHandle(_readWriteBinding);

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

                _readWriteBinding.Received().GetReadChannelSourceAsync(CancellationToken.None);
            }
            else
            {
                subject.GetReadChannelSource(CancellationToken.None);

                _readWriteBinding.Received().GetReadChannelSource(CancellationToken.None);
            }
        }