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); }
public MongoCollectionClient(IDatabaseMongoClient databaseMongoClient, IDatabaseConfig databaseConfig) { _mongoDatabase = databaseMongoClient.MongoClient.GetDatabase(databaseConfig.Name); }