Пример #1
0
 public void CreatesDigestFromNonce()
 {
     using (var connection = new DisposableConnection(ConnectionStringBuilder.Create(TestHelper.ConnectionString("querytimeout=30&strict=false&expando=false", "ussrr", "ppaassss"))))
     {
         Assert.Equal("08f11f775e2a8cf4248f0ae6126164f0", connection.Digest("1234abc"));
     }
 }
Пример #2
0
 public void CreatesDigestFromNonce()
 {
     using (var connection = new DisposableConnection(ConnectionStringBuilder.Create(TestHelper.ConnectionString("querytimeout=30&strict=false", "ussrr", "ppaassss"))))
     {
         Assert.Equal("21069b52452d123b3f4885400c1c9581", connection.Digest("1234abc"));
     }
 }
Пример #3
0
 public void ThrowsExceptionWhenTryingToOverrideLifetime()
 {
     using (var connection = new DisposableConnection(ConnectionStringBuilder.Create(TestHelper.ConnectionString())))
     {
         var ex = Assert.Throws<MongoException>(() => connection.LoadOptions("lifetime=23"));
         Assert.Equal("Lifetime cannot be provided as an override option", ex.Message);
     }
 }
Пример #4
0
 public void ThrowsExceptionWhenTryingToOverrideLifetime()
 {
     using (var connection = new DisposableConnection(ConnectionStringBuilder.Create(TestHelper.ConnectionString())))
     {
         var ex = Assert.Throws <MongoException>(() => connection.LoadOptions("lifetime=23"));
         Assert.Equal("Lifetime cannot be provided as an override option", ex.Message);
     }
 }
Пример #5
0
 public void OverridesStrictMode()
 {
     using (var connection = new DisposableConnection(ConnectionStringBuilder.Create(TestHelper.ConnectionString("?strict=true"))))
     {
         Assert.Equal(true, connection.StrictMode);
         connection.LoadOptions("strict=false");
         Assert.Equal(false, connection.StrictMode);
     }
 }
Пример #6
0
 public void OverridesQueryTimeout()
 {
     using (var connection = new DisposableConnection(ConnectionStringBuilder.Create(TestHelper.ConnectionString("querytimeout=30"))))
     {
         Assert.Equal(30, connection.QueryTimeout);
         connection.LoadOptions("querytimeout=32");
         Assert.Equal(32, connection.QueryTimeout);
     }
 }
Пример #7
0
 public void OverridesExpando()
 {
     using (var connection = new DisposableConnection(ConnectionStringBuilder.Create(TestHelper.ConnectionString("expando=true"))))
     {
         Assert.Equal(true, connection.EnableExpandoProperties);
         connection.LoadOptions("expando=false");
         Assert.Equal(false, connection.EnableExpandoProperties);
     }
 }
Пример #8
0
 public void OverridesQueryTimeout()
 {
     using (var connection = new DisposableConnection(ConnectionStringBuilder.Create(TestHelper.ConnectionString("querytimeout=30"))))
     {
         Assert.Equal(30, connection.QueryTimeout);
         connection.LoadOptions("querytimeout=32");
         Assert.Equal(32, connection.QueryTimeout);
     }
 }
Пример #9
0
 public void OverridesStrictMode()
 {
     using (var connection = new DisposableConnection(ConnectionStringBuilder.Create(TestHelper.ConnectionString("?strict=true"))))
     {
         Assert.Equal(true, connection.StrictMode);
         connection.LoadOptions("strict=false");
         Assert.Equal(false, connection.StrictMode);
     }
 }
Пример #10
0
        public void ResetsDefaults()
        {
            using (var connection = new DisposableConnection(ConnectionStringBuilder.Create(TestHelper.ConnectionString("querytimeout=30&strict=false"))))
            {
                connection.LoadOptions("querytimeout=23&strict=true");
                Assert.Equal(true, connection.StrictMode);
                Assert.Equal(23, connection.QueryTimeout);

                connection.ResetOptions();
                Assert.Equal(false, connection.StrictMode);
                Assert.Equal(30, connection.QueryTimeout);
            }
        }
Пример #11
0
        public void ResetsDefaults()
        {
            using (var connection = new DisposableConnection(ConnectionStringBuilder.Create(TestHelper.ConnectionString("querytimeout=30&strict=false"))))
            {
                connection.LoadOptions("querytimeout=23&strict=true");
                Assert.Equal(true, connection.StrictMode);
                Assert.Equal(23, connection.QueryTimeout);

                connection.ResetOptions();
                Assert.Equal(false, connection.StrictMode);
                Assert.Equal(30, connection.QueryTimeout);
            }
        }
Пример #12
0
 public void CreatesDigestFromNonce()
 {
     using (var connection = new DisposableConnection(ConnectionStringBuilder.Create(TestHelper.ConnectionString("querytimeout=30&strict=false", "ussrr", "ppaassss"))))
     {
         Assert.Equal("21069b52452d123b3f4885400c1c9581", connection.Digest("1234abc"));
     }
 }