Esempio n. 1
0
        private static IEdificeDatabase GetTestDatabase()
        {
            var connection = new EdificeMongoDbConnection(EdificeMongoDbConnection.TEST_DB_NAME);
            var db         = connection.FindDatabaseByName(EdificeMongoDbConnection.TEST_DB_NAME);

            return(db);
        }
Esempio n. 2
0
        public void FixtureSetup()
        {
            var connection = new EdificeMongoDbConnection(EdificeMongoDbConnection.TEST_DB_NAME);
            var db         = connection.FindDatabaseByName(EdificeMongoDbConnection.TEST_DB_NAME);
            var coll       = db.FindElementCollectionByName(EdificeMongoDbConnection.TEST_COLLECTION_NAME);

            ElementFactory.Initialize(coll);
        }
Esempio n. 3
0
        public void ReturnsNullWhenAttemptingToGeDbThatDoesNotExist()
        {
            var connection = new EdificeMongoDbConnection(EdificeMongoDbConnection.TEST_DB_NAME);

            Assert.NotNull(connection);
            var db = connection.FindDatabaseByName("blah");

            Assert.Null(db);
        }
Esempio n. 4
0
        public static object GetTracedObjectById(Guid id)
        {
            var connection = new EdificeMongoDbConnection();

            var db   = connection.FindDatabaseByName(EdificeMongoDbConnection.DEFAULT_DB_NAME);
            var coll = db.FindElementCollectionByName(EdificeMongoDbConnection.DEFAULT_ELEMENT_COLLECTION_NAME);
            var el   = coll.FindElementById(id);

            return(el);
        }
Esempio n. 5
0
        public void Setup()
        {
            var connection = new EdificeMongoDbConnection(EdificeMongoDbConnection.TEST_DB_NAME);

            var db = connection.FindDatabaseByName(EdificeMongoDbConnection.TEST_DB_NAME);

            // Add three elements
            var e1 = new TestElement("ElementA", TEST_GUID_A);
            var e2 = new TestElement("ElementB", TEST_GUID_B);
            var e3 = new TestElement("ElementC", TEST_GUID_C);

            var collection = db.FindElementCollectionByName(EdificeMongoDbConnection.TEST_COLLECTION_NAME);

            collection.CreateElement(e1);
            collection.CreateElement(e2);
            collection.CreateElement(e3);
        }