public void Fork_should_throw_if_disposed()
        {
            var subject = new ChannelSourceHandle(_channelSource);

            subject.Dispose();

            Action act = () => subject.Fork();

            act.ShouldThrow <ObjectDisposedException>();
        }
        public void Disposing_of_last_handle_should_dispose_of_connectioSource()
        {
            var subject = new ChannelSourceHandle(_channelSource);

            var forked = subject.Fork();

            subject.Dispose();
            forked.Dispose();

            _channelSource.Received().Dispose();
        }
        public void Disposing_of_last_handle_should_dispose_of_connectioSource()
        {
            var subject = new ChannelSourceHandle(_mockChannelSource.Object);

            var forked = subject.Fork();

            subject.Dispose();
            forked.Dispose();

            _mockChannelSource.Verify(s => s.Dispose(), Times.Once);
        }
        public void Disposing_of_fork_before_disposing_of_subject_hould_not_dispose_of_channelSource()
        {
            var subject = new ChannelSourceHandle(_channelSource);

            var forked = subject.Fork();

            forked.Dispose();

            _channelSource.DidNotReceive().Dispose();

            subject.Dispose();

            _channelSource.Received().Dispose();
        }
        public void Disposing_of_fork_before_disposing_of_subject_hould_not_dispose_of_channelSource()
        {
            var subject = new ChannelSourceHandle(_mockChannelSource.Object);

            var forked = subject.Fork();

            forked.Dispose();

            _mockChannelSource.Verify(s => s.Dispose(), Times.Never);

            subject.Dispose();

            _mockChannelSource.Verify(s => s.Dispose(), Times.Once);
        }
Ejemplo n.º 6
0
        public void Disposing_of_handle_after_fork_should_not_dispose_of_channelSource()
        {
            var subject = new ChannelSourceHandle(_mockChannelSource.Object);

            var forked = subject.Fork();

            subject.Dispose();

            _mockChannelSource.Verify(s => s.Dispose(), Times.Never);

            forked.Dispose();

            _mockChannelSource.Verify(s => s.Dispose(), Times.Once);
        }
Ejemplo n.º 7
0
        public void Fork_should_throw_if_disposed()
        {
            var subject = new ChannelSourceHandle(_mockChannelSource.Object);
            subject.Dispose();

            Action act = () => subject.Fork();

            act.ShouldThrow<ObjectDisposedException>();
        }
Ejemplo n.º 8
0
        public void Disposing_of_last_handle_should_dispose_of_connectioSource()
        {
            var subject = new ChannelSourceHandle(_mockChannelSource.Object);

            var forked = subject.Fork();

            subject.Dispose();
            forked.Dispose();

            _mockChannelSource.Verify(s => s.Dispose(), Times.Once);
        }
        public void Disposing_of_handle_after_fork_should_not_dispose_of_channelSource()
        {
            var subject = new ChannelSourceHandle(_channelSource);

            var forked = subject.Fork();

            subject.Dispose();

            _channelSource.DidNotReceive().Dispose();

            forked.Dispose();

            _channelSource.Received().Dispose();
        }
        public void Disposing_of_last_handle_should_dispose_of_connectioSource()
        {
            var subject = new ChannelSourceHandle(_channelSource);

            var forked = subject.Fork();

            subject.Dispose();
            forked.Dispose();

            _channelSource.Received().Dispose();
        }