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>(); }
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>(); }