public void TestClassWithArrayId()
        {
            _collection.RemoveAll();

            var doc = new ClassWithArrayId { Id = null, X = 1 };
            _collection.Insert(doc);

            doc = new ClassWithArrayId { Id = new int[] { }, X = 1 };
            Assert.Throws<MongoWriteConcernException>(() => { _collection.Insert(doc); });

            doc = new ClassWithArrayId { Id = new int[] { 1, 2, 3 }, X = 1 };
            Assert.Throws<MongoWriteConcernException>(() => { _collection.Insert(doc); });
        }
Esempio n. 2
0
        public void TestClassWithArrayId()
        {
            collection.RemoveAll();

            var doc = new ClassWithArrayId {
                Id = null, X = 1
            };

            collection.Insert(doc);

            doc = new ClassWithArrayId {
                Id = new int[] { }, X = 1
            };
            Assert.Throws <MongoSafeModeException>(() => { collection.Insert(doc); });

            doc = new ClassWithArrayId {
                Id = new int[] { 1, 2, 3 }, X = 1
            };
            Assert.Throws <MongoSafeModeException>(() => { collection.Insert(doc); });
        }
Esempio n. 3
0
        public void TestClassWithArrayId()
        {
            _collection.RemoveAll();

            var doc = new ClassWithArrayId { Id = null, X = 1 };
            _collection.Insert(doc);

            doc = new ClassWithArrayId { Id = new int[] { }, X = 1 };
            Assert.Throws<MongoWriteConcernException>(() => { _collection.Insert(doc); });

            doc = new ClassWithArrayId { Id = new int[] { 1, 2, 3 }, X = 1 };
            Assert.Throws<MongoWriteConcernException>(() => { _collection.Insert(doc); });
        }
        public void TestClassWithArrayId()
        {
            collection.RemoveAll();

            var doc = new ClassWithArrayId { Id = null, X = 1 };
            collection.Insert(doc);

            doc = new ClassWithArrayId { Id = new int[] { }, X = 1 };
            Assert.Throws<MongoSafeModeException>(() => { collection.Insert(doc); });

            doc = new ClassWithArrayId { Id = new int[] { 1, 2, 3 }, X = 1 };
            Assert.Throws<MongoSafeModeException>(() => { collection.Insert(doc); });
        }