Пример #1
0
        public void RespectDriverOverrideInBase()
        {
            var collection = MongoFactory.GetDefaultCollection <BsonDocument>();

            this.OverrideConnectionDriver(new MongoDBDriver <BsonDocument>(collection));

            Assert.AreEqual(collection, this.MongoDBDriver.Collection);
        }
Пример #2
0
        public void RespectCollectionOverride()
        {
            var collection = MongoFactory.GetDefaultCollection <BsonDocument>();

            this.TestObject.OverrideMongoDBDriver(() => collection);

            Assert.AreEqual(collection, this.MongoDBDriver.Collection);
        }
Пример #3
0
        public void OverrideDriver()
        {
            var firstDriver = this.MongoDBDriver;
            var newDriver   = new MongoDBDriver <BsonDocument>(MongoFactory.GetDefaultCollection <BsonDocument>());

            this.TestObject.OverrideMongoDBDriver(newDriver);

            Assert.AreNotEqual(firstDriver, this.MongoDBDriver);
            Assert.AreEqual(newDriver, this.MongoDBDriver);
            Assert.IsFalse(this.MongoDBDriver.IsCollectionEmpty());
        }
Пример #4
0
        public void OverrideCollectionFunction()
        {
            var collection    = this.MongoDBDriver.Collection;
            var newCollection = MongoFactory.GetDefaultCollection <BsonDocument>();

            this.TestObject.OverrideMongoDBDriver(() => newCollection);

            Assert.AreNotEqual(collection, this.MongoDBDriver.Collection);
            Assert.AreEqual(newCollection, this.MongoDBDriver.Collection);
            Assert.IsFalse(this.MongoDBDriver.IsCollectionEmpty());
        }