本文整理汇总了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));
}