public void constructor_should_initialize_instance()
        {
            var server  = new Mock <IServer>().Object;
            var session = new Mock <ICoreSessionHandle>().Object;

            var result = new SingleServerReadWriteBinding(server, session);

            result._disposed().Should().BeFalse();
            result._server().Should().BeSameAs(server);
            result.Session.Should().BeSameAs(session);
        }
 private async Task<IReadWriteBindingHandle> GetSingleServerReadWriteBindingAsync(CancellationToken cancellationToken)
 {
     var selector = WritableServerSelector.Instance;
     var server = await _cluster.SelectServerAsync(selector, cancellationToken).ConfigureAwait(false);
     var binding = new SingleServerReadWriteBinding(server);
     return new ReadWriteBindingHandle(binding);
 }
        public static bool _disposed(this SingleServerReadWriteBinding obj)
        {
            var fieldInfo = typeof(SingleServerReadWriteBinding).GetField("_disposed", BindingFlags.NonPublic | BindingFlags.Instance);

            return((bool)fieldInfo.GetValue(obj));
        }
        public static IServer _server(this SingleServerReadWriteBinding obj)
        {
            var fieldInfo = typeof(SingleServerReadWriteBinding).GetField("_server", BindingFlags.NonPublic | BindingFlags.Instance);

            return((IServer)fieldInfo.GetValue(obj));
        }
 private IReadWriteBindingHandle GetSingleServerReadWriteBinding(CancellationToken cancellationToken)
 {
     var selector = WritableServerSelector.Instance;
     var server = _cluster.SelectServer(selector, cancellationToken);
     var binding = new SingleServerReadWriteBinding(server);
     return new ReadWriteBindingHandle(binding);
 }