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")); } }
public void CreatesDigestFromNonce() { using (var connection = new DisposableConnection(ConnectionStringBuilder.Create(TestHelper.ConnectionString("querytimeout=30&strict=false", "ussrr", "ppaassss")))) { Assert.Equal("21069b52452d123b3f4885400c1c9581", connection.Digest("1234abc")); } }
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); } }
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); } }
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); } }
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); } }
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); } }
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); } }