Beispiel #1
0
        public void GetWriteChannelSourceAsync_should_get_the_connection_source_from_the_write_binding()
        {
            var subject = new SplitReadWriteBinding(_readBinding, _writeBinding);

            subject.GetWriteChannelSourceAsync(CancellationToken.None);

            _writeBinding.Received().GetWriteChannelSourceAsync(CancellationToken.None);
        }
        public void GetWriteChannelSource_should_get_the_connection_source_from_the_write_binding(
            [Values(false, true)]
            bool async)
        {
            var subject = new SplitReadWriteBinding(_readBinding, _writeBinding);

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

                _writeBinding.Received().GetWriteChannelSourceAsync(CancellationToken.None);
            }
            else
            {
                subject.GetWriteChannelSource(CancellationToken.None);

                _writeBinding.Received().GetWriteChannelSource(CancellationToken.None);
            }
        }