예제 #1
0
        public void Intialized()
        {
            MongoDriverManager <BsonDocument> driverDriver = this.ManagerStore.GetManager <MongoDriverManager <BsonDocument> >();

            Assert.IsNotNull(this.MongoDBDriver.Client, "Should be able to get client");
            Assert.IsTrue(driverDriver.IsDriverIntialized(), "The driver should have been initialized");
        }
예제 #2
0
        public void Intialized()
        {
            // Do something so we initialize the web driver
            this.MongoDBDriver.IsCollectionEmpty();

            MongoDriverManager <BsonDocument> driverDriver = this.ManagerStore[typeof(MongoDriverManager <BsonDocument>).FullName] as MongoDriverManager <BsonDocument>;

            Assert.IsTrue(driverDriver.IsDriverIntialized(), "The driver should have been initialized");
        }
예제 #3
0
        public void CanUseMultiple()
        {
            MongoDriverManager <BsonDocument> newDriver = new MongoDriverManager <BsonDocument>(MongoDBConfig.GetConnectionString(), MongoDBConfig.GetDatabaseString(), MongoDBConfig.GetCollectionString(), this.TestObject);

            this.ManagerStore.Add("test", newDriver);

            Assert.AreNotEqual(this.TestObject.MongoDBDriver, (MongoDriverManager <BsonDocument>) this.ManagerStore["test"]);
            Assert.AreNotEqual(this.TestObject.MongoDBManager.Get(), ((MongoDriverManager <BsonDocument>) this.ManagerStore["test"]).Get());
        }
예제 #4
0
        public void CanUseMultipleWithFunc()
        {
            var newCollection = MongoFactory.GetCollection <BsonDocument>(MongoDBConfig.GetConnectionString(), MongoDBConfig.GetDatabaseString(), MongoDBConfig.GetCollectionString());

            MongoDriverManager <BsonDocument> newDriver = new MongoDriverManager <BsonDocument>(() => newCollection, this.TestObject);

            this.ManagerStore.Add("test", newDriver);

            Assert.AreNotEqual(this.TestObject.MongoDBDriver, (MongoDriverManager <BsonDocument>) this.ManagerStore["test"]);
            Assert.AreNotEqual(this.TestObject.MongoDBManager.Get(), ((MongoDriverManager <BsonDocument>) this.ManagerStore["test"]).Get());
            Assert.AreEqual(newCollection, ((MongoDriverManager <BsonDocument>) this.ManagerStore["test"]).GetMongoDriver().Collection);
        }
예제 #5
0
        public void NotIntialized()
        {
            MongoDriverManager <BsonDocument> driverDriver = this.ManagerStore[typeof(MongoDriverManager <BsonDocument>).FullName] as MongoDriverManager <BsonDocument>;

            Assert.IsFalse(driverDriver.IsDriverIntialized(), "The driver should not be initialized until it gets used");
        }
예제 #6
0
        public void NotIntialized()
        {
            MongoDriverManager <BsonDocument> driverDriver = this.ManagerStore.GetManager <MongoDriverManager <BsonDocument> >();

            Assert.IsFalse(driverDriver.IsDriverIntialized(), "The driver should not be initialized until it gets used");
        }