public void GetReadConnectionSourceAsync_should_use_a_writable_server_selector_to_select_the_server_from_the_cluster()
        {
            var subject = new WritableServerBinding(_cluster);

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

            _cluster.Received().SelectServerAsync(Arg.Any<WritableServerSelector>(), Timeout.InfiniteTimeSpan, CancellationToken.None);
        }
        public void GetReadConnectionSourceAsync_should_use_a_writable_server_selector_to_select_the_server_from_the_cluster()
        {
            var subject = new WritableServerBinding(_cluster);

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

            _cluster.Received().SelectServerAsync(Arg.Any <WritableServerSelector>(), Timeout.InfiniteTimeSpan, CancellationToken.None);
        }
        public void GetReadConnectionSourceAsync_should_throw_if_disposed()
        {
            var subject = new WritableServerBinding(_cluster);
            subject.Dispose();

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

            act.ShouldThrow<ObjectDisposedException>();
        }
        public void GetReadConnectionSourceAsync_should_throw_if_disposed()
        {
            var subject = new WritableServerBinding(_cluster);

            subject.Dispose();

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

            act.ShouldThrow <ObjectDisposedException>();
        }