예제 #1
0
 public void Setup()
 {
     _mongoDatabase       = Substitute.For <IMongoDatabase>();
     _databaseMongoClient = Substitute.For <IDatabaseMongoClient>();
     _databaseConfig      = Substitute.For <IDatabaseConfig>();
     _mongoClient         = Substitute.For <IMongoClient>();
     _mongoCollection     = Substitute.For <IMongoCollection <object> >();
     _databaseMongoClient.MongoClient.Returns(_mongoClient);
     _mongoClient.GetDatabase(_databaseConfig.Name).Returns(_mongoDatabase);
     _mongoCollectionClientInstance = new MongoCollectionClient <object>(_databaseMongoClient, _databaseConfig);
 }
예제 #2
0
 public MongoCollectionClient(IDatabaseMongoClient databaseMongoClient, IDatabaseConfig databaseConfig)
 {
     _mongoDatabase = databaseMongoClient.MongoClient.GetDatabase(databaseConfig.Name);
 }