public async Task CreateConnectionAsync_NoBucket_DoesNotSelectBucket()
        {
            // Arrange

            var ipEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9999);

            var connectionInitializer = new Mock <IConnectionInitializer>();

            connectionInitializer
            .SetupGet(m => m.EndPoint)
            .Returns(ipEndPoint);

            var connection = new Mock <IConnection>();

            var connectionFactory = new Mock <IConnectionFactory>();

            connectionFactory
            .Setup(m => m.CreateAndConnectAsync(ipEndPoint, It.IsAny <CancellationToken>()))
            .ReturnsAsync(connection.Object);

            var pool = new ConnectionPoolMock(connectionInitializer.Object, connectionFactory.Object);

            // Act

            var result = await pool.CreateConnectionAsyncPublic();

            // Assert

            connectionInitializer.Verify(
                m => m.SelectBucketAsync(It.IsAny <IConnection>(), It.IsAny <string>(), It.IsAny <CancellationToken>()),
                Times.Never);
        }
        public async Task CreateConnectionAsync_ReturnsFromFactory_WithInitializerEndpoint()
        {
            // Arrange

            var ipEndPoint = new IPEndPoint(IPAddress.Parse("127.0.0.1"), 9999);

            var connectionInitializer = new Mock <IConnectionInitializer>();

            connectionInitializer
            .SetupGet(m => m.EndPoint)
            .Returns(ipEndPoint);

            var connection = new Mock <IConnection>();

            var connectionFactory = new Mock <IConnectionFactory>();

            connectionFactory
            .Setup(m => m.CreateAndConnectAsync(ipEndPoint, It.IsAny <CancellationToken>()))
            .ReturnsAsync(connection.Object);

            var pool = new ConnectionPoolMock(connectionInitializer.Object, connectionFactory.Object);

            // Act

            var result = await pool.CreateConnectionAsyncPublic();

            // Assert

            Assert.Equal(connection.Object, result);
        }