Beispiel #1
0
        public void TestFrozenCopy()
        {
            var settings = new MongoClientSettings();
            Assert.AreEqual(false, settings.IsFrozen);

            var frozenCopy = settings.FrozenCopy();
            Assert.AreEqual(true, frozenCopy.IsFrozen);
            Assert.AreNotSame(settings, frozenCopy);
            Assert.AreEqual(settings, frozenCopy);

            var secondFrozenCopy = frozenCopy.FrozenCopy();
            Assert.AreSame(frozenCopy, secondFrozenCopy);
        }
        public void TestFrozenCopy()
        {
            var settings = new MongoClientSettings();
            Assert.AreEqual(false, settings.IsFrozen);

            var frozenCopy = settings.FrozenCopy();
            Assert.AreEqual(true, frozenCopy.IsFrozen);
            Assert.AreNotSame(settings, frozenCopy);
            Assert.AreEqual(settings, frozenCopy);

            var secondFrozenCopy = frozenCopy.FrozenCopy();
            Assert.AreSame(frozenCopy, secondFrozenCopy);
        }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the MongoClient class.
 /// </summary>
 /// <param name="settings">The settings.</param>
 public MongoClient(MongoClientSettings settings)
 {
     _settings = settings.FrozenCopy();
 }
 /// <summary>
 /// Initializes a new instance of the MongoClient class.
 /// </summary>
 /// <param name="settings">The settings.</param>
 public MongoClient(MongoClientSettings settings)
 {
     _settings = settings.FrozenCopy();
 }