Exemplo n.º 1
0
        public void GetReadConnectionSourceAsync_should_fork_the_connectionSource()
        {
            var subject = new ConnectionSourceReadWriteBinding(_connectionSource, ReadPreference.Primary);

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

            _connectionSource.Received().Fork();
        }
        public void GetReadConnectionSourceAsync_should_fork_the_connectionSource()
        {
            var subject = new ConnectionSourceReadWriteBinding(_connectionSource, ReadPreference.Primary);

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

            _connectionSource.Received().Fork();
        }
        public void GetReadConnectionSourceAsync_should_throw_if_disposed()
        {
            var subject = new ConnectionSourceReadWriteBinding(_connectionSource, ReadPreference.Primary);
            subject.Dispose();

            Action act = () => subject.GetReadConnectionSourceAsync(Timeout.InfiniteTimeSpan, CancellationToken.None);

            act.ShouldThrow<ObjectDisposedException>();
        }
Exemplo n.º 4
0
        public void GetReadConnectionSourceAsync_should_throw_if_disposed()
        {
            var subject = new ConnectionSourceReadWriteBinding(_connectionSource, ReadPreference.Primary);

            subject.Dispose();

            Action act = () => subject.GetReadConnectionSourceAsync(Timeout.InfiniteTimeSpan, CancellationToken.None);

            act.ShouldThrow <ObjectDisposedException>();
        }