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"); }
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"); }
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()); }
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); }
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"); }
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"); }