public void TestFixtureSetUp() { var databaseNamespace = CoreTestConfiguration.GetDatabaseNamespaceForTestFixture(); _collectionNamespace = new CollectionNamespace(databaseNamespace, "ListIndexesOperationTests"); _messageEncoderSettings = CoreTestConfiguration.MessageEncoderSettings; }
public void TestGetCollectionNames() { var databaseNamespace = CoreTestConfiguration.GetDatabaseNamespaceForTestFixture(); var database = _server.GetDatabase(databaseNamespace.DatabaseName); database.Drop(); database.GetCollection("a").Insert(new BsonDocument("a", 1)); database.GetCollection("b").Insert(new BsonDocument("b", 1)); database.GetCollection("c").Insert(new BsonDocument("c", 1)); var collectionNames = database.GetCollectionNames(); Assert.AreEqual(new[] { "a", "b", "c" }, collectionNames.Where(n => n != "system.indexes")); }
public void TestDatabaseExists() { if (!_isMasterSlavePair) { var databaseNamespace = CoreTestConfiguration.GetDatabaseNamespaceForTestFixture(); var database = _server.GetDatabase(databaseNamespace.DatabaseName); var collection = database.GetCollection("test"); database.Drop(); Assert.IsFalse(_server.DatabaseExists(database.Name)); collection.Insert(new BsonDocument("x", 1)); Assert.IsTrue(_server.DatabaseExists(database.Name)); } }
// setup method public override void TestFixtureSetUp() { base.TestFixtureSetUp(); _databaseNamespace = CoreTestConfiguration.GetDatabaseNamespaceForTestFixture(); }
public void OneTimeSetUp() { _databaseNamespace = CoreTestConfiguration.GetDatabaseNamespaceForTestFixture(); _messageEncoderSettings = CoreTestConfiguration.MessageEncoderSettings; }
// setup methods public override void OneTimeSetUp() { _databaseNamespace = CoreTestConfiguration.GetDatabaseNamespaceForTestFixture(); _collectionNamespace = new CollectionNamespace(_databaseNamespace, "old"); _newCollectionNamespace = new CollectionNamespace(_databaseNamespace, "new"); }