示例#1
0
        public void TestFixtureSetUp()
        {
            var databaseNamespace = CoreTestConfiguration.GetDatabaseNamespaceForTestFixture();

            _collectionNamespace    = new CollectionNamespace(databaseNamespace, "ListIndexesOperationTests");
            _messageEncoderSettings = CoreTestConfiguration.MessageEncoderSettings;
        }
示例#2
0
        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));
            }
        }
示例#4
0
 // setup method
 public override void TestFixtureSetUp()
 {
     base.TestFixtureSetUp();
     _databaseNamespace = CoreTestConfiguration.GetDatabaseNamespaceForTestFixture();
 }
示例#5
0
 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");
 }