本文整理匯總了C#中MongoDB.Driver.MongoClientSettings.Clone方法的典型用法代碼示例。如果您正苦於以下問題:C# MongoClientSettings.Clone方法的具體用法?C# MongoClientSettings.Clone怎麽用?C# MongoClientSettings.Clone使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類MongoDB.Driver.MongoClientSettings
的用法示例。
在下文中一共展示了MongoClientSettings.Clone方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: TestEquals
public void TestEquals()
{
var settings = new MongoClientSettings();
var clone = settings.Clone();
Assert.IsTrue(clone.Equals(settings));
clone = settings.Clone();
clone.ConnectionMode = ConnectionMode.Direct;
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.ConnectTimeout = new TimeSpan(1, 2, 3);
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.CredentialsStore = new MongoCredentialsStore();
clone.CredentialsStore.AddCredentials("db2", new MongoCredentials("user2", "password2"));
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.DefaultCredentials = new MongoCredentials("user2", "password2");
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.GuidRepresentation = GuidRepresentation.PythonLegacy;
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.IPv6 = !settings.IPv6;
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.MaxConnectionIdleTime = new TimeSpan(1, 2, 3);
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.MaxConnectionLifeTime = new TimeSpan(1, 2, 3);
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.MaxConnectionPoolSize = settings.MaxConnectionPoolSize + 1;
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.MinConnectionPoolSize = settings.MinConnectionPoolSize + 1;
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.ReadPreference = ReadPreference.Secondary;
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.ReplicaSetName = "abc";
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.SecondaryAcceptableLatency = new TimeSpan(1, 2, 3);
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.Server = new MongoServerAddress("someotherhost");
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.SocketTimeout = new TimeSpan(1, 2, 3);
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.UseSsl = !settings.UseSsl;
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.VerifySslCertificate = !settings.VerifySslCertificate;
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.WaitQueueSize = settings.WaitQueueSize + 1;
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.WaitQueueTimeout = new TimeSpan(1, 2, 3);
Assert.IsFalse(clone.Equals(settings));
clone = settings.Clone();
clone.WriteConcern = WriteConcern.W2;
Assert.IsFalse(clone.Equals(settings));
}