Exemplo n.º 1
0
        public void When_compressor_is_specified(string connectionString, CompressorType compressor)
        {
            var subject = new ConnectionString(connectionString);

            subject.Compressors.Should().Contain(x => x.Type == compressor);
        }
        public void When_username_is_specified(string connectionString, string username)
        {
            var subject = new ConnectionString(connectionString);

            subject.Username.Should().Be(username);
        }
        public void When_waitQueueMultiple_is_specified(string connectionString, int waitQueueMultiple)
        {
            var subject = new ConnectionString(connectionString);

            subject.WaitQueueMultiple.Should().Be(waitQueueMultiple);
        }
        public void When_replicaSet_is_specified(string connectionString, string replicaSet)
        {
            var subject = new ConnectionString(connectionString);

            subject.ReplicaSet.Should().Be(replicaSet);
        }
        public void When_ssl_is_specified(string connectionString, bool ssl)
        {
            var subject = new ConnectionString(connectionString);

            subject.Ssl.Should().Be(ssl);
        }
        public void When_maxLifeTime_is_specified(string connectionString, int milliseconds)
        {
            var subject = new ConnectionString(connectionString);

            subject.MaxLifeTime.Should().Be(TimeSpan.FromMilliseconds(milliseconds));
        }
        public void When_password_is_specified(string connectionString, string password)
        {
            var subject = new ConnectionString(connectionString);

            subject.Password.Should().Be(password);
        }
Exemplo n.º 8
0
        public void When_no_maxStaleness_is_specified(string connectionString)
        {
            var subject = new ConnectionString(connectionString);

            subject.MaxStaleness.Should().NotHaveValue();
        }
Exemplo n.º 9
0
        public void When_readConcernLevel_is_specified(string connectionString, ReadConcernLevel readConcernLevel)
        {
            var subject = new ConnectionString(connectionString);

            subject.ReadConcernLevel.Should().Be(readConcernLevel);
        }
Exemplo n.º 10
0
        public void When_gssapiServiceName_is_specified(string connectionString, string gssapiServiceName)
        {
            var subject = new ConnectionString(connectionString);

            subject.AuthMechanismProperties["service_name"].Should().Be(gssapiServiceName);
        }
Exemplo n.º 11
0
        public void When_heartbeat_timeout_is_specified(string connectionString, int milliseconds)
        {
            var subject = new ConnectionString(connectionString);

            subject.HeartbeatTimeout.Should().Be(TimeSpan.FromMilliseconds(milliseconds));
        }
Exemplo n.º 12
0
        public void constructor_with_isResolved_should_initialize_isResolved(string connectionString, bool isResolved)
        {
            var subject = new ConnectionString(connectionString, isResolved);

            subject.IsResolved.Should().Be(isResolved);
        }
Exemplo n.º 13
0
        public void When_connect_is_specified(string connectionString, ClusterConnectionMode connect)
        {
            var subject = new ConnectionString(connectionString);

            subject.Connect.Should().Be(connect);
        }
Exemplo n.º 14
0
        public void When_compressor_is_specified_with_unsupported_value_the_value_should_be_ignored(string connectionString)
        {
            var subject = new ConnectionString(connectionString);

            subject.Compressors.Should().BeEmpty();
        }
        public void When_ipv6_is_specified(string connectionString, bool ipv6)
        {
            var subject = new ConnectionString(connectionString);

            subject.Ipv6.Should().Be(ipv6);
        }
Exemplo n.º 16
0
        public void When_retryWrites_is_specified(string connectionString, bool?retryWrites)
        {
            var subject = new ConnectionString(connectionString);

            subject.RetryWrites.Should().Be(retryWrites);
        }
        public void When_j_is_specified(string connectionString, bool j)
        {
            var subject = new ConnectionString(connectionString);

            subject.Journal.Should().Be(j);
        }
Exemplo n.º 18
0
        public void When_localThreshold_is_specified(string connectionString, int milliseconds)
        {
            var subject = new ConnectionString(connectionString);

            subject.LocalThreshold.Should().Be(TimeSpan.FromMilliseconds(milliseconds));
        }
        public void When_minPoolSize_is_specified(string connectionString, int minPoolSize)
        {
            var subject = new ConnectionString(connectionString);

            subject.MinPoolSize.Should().Be(minPoolSize);
        }
        public void When_authMechanism_is_specified(string connectionString, string authMechanism)
        {
            var subject = new ConnectionString(connectionString);

            subject.AuthMechanism.Should().Be(authMechanism);
        }
        public void When_readPreference_is_specified(string connectionString, ReadPreferenceMode readPreference)
        {
            var subject = new ConnectionString(connectionString);

            subject.ReadPreference.Should().Be(readPreference);
        }
        public void When_authSource_is_specified(string connectionString, string authSource)
        {
            var subject = new ConnectionString(connectionString);

            subject.AuthSource.Should().Be(authSource);
        }
        public void When_secondaryAcceptableLatency_is_specified(string connectionString, int milliseconds)
        {
            var subject = new ConnectionString(connectionString);

            subject.SecondaryAcceptableLatency.Should().Be(TimeSpan.FromMilliseconds(milliseconds));
        }
        public void When_a_database_name_is_specified(string connectionString, string db)
        {
            var subject = new ConnectionString(connectionString);

            subject.DatabaseName.Should().Be(db);
        }
        public void When_sslVerifyCertificate_is_specified(string connectionString, bool sslVerifyCertificate)
        {
            var subject = new ConnectionString(connectionString);

            subject.SslVerifyCertificate.Should().Be(sslVerifyCertificate);
        }
        public void When_fsync_is_specified(string connectionString, bool fsync)
        {
            var subject = new ConnectionString(connectionString);

            subject.FSync.Should().Be(fsync);
        }
        public void When_uuidRepresentation_is_specified(string connectionString, GuidRepresentation representation)
        {
            var subject = new ConnectionString(connectionString);

            subject.UuidRepresentation.Should().Be(representation);
        }
        public void When_gssapiServiceName_is_specified(string connectionString, string gssapiServiceName)
        {
            var subject = new ConnectionString(connectionString);

            subject.GssapiServiceName.Should().Be(gssapiServiceName);
        }
        public void When_waitQueueTimeout_is_specified(string connectionString, int milliseconds)
        {
            var subject = new ConnectionString(connectionString);

            subject.WaitQueueTimeout.Should().Be(TimeSpan.FromMilliseconds(milliseconds));
        }
Exemplo n.º 30
0
        public void constructor_should_initialize_isResolved(string connectionString, bool expectedIsResolved)
        {
            var subject = new ConnectionString(connectionString);

            subject.IsResolved.Should().Be(expectedIsResolved);
        }