Exemple #1
0
        public void DeleteDatabase_DatabaseExist_DoTheThingsOK()
        {
            AbstractParser xmlParser    = CreateXMLParser();
            Database       testDatabase = ObjectConstructor.CreateDatabaseFull("test4");

            xmlParser.SaveDatabase(testDatabase);
            Assert.IsTrue(xmlParser.ExistDatabase(testDatabase.databaseName));
            xmlParser.DeleteDatabase(testDatabase.databaseName);
            Assert.IsFalse(xmlParser.ExistDatabase(testDatabase.databaseName));
        }
Exemple #2
0
        public void SaveAndLoadDatabase()
        {
            AbstractParser xmlParser    = CreateXMLParser();
            Database       testDatabase = ObjectConstructor.CreateDatabaseFull("test1");

            xmlParser.SaveDatabase(testDatabase);
            Database loadedDatabase = xmlParser.LoadDatabase(testDatabase.databaseName);

            Assert.IsTrue(Database.GetDatabaseComparer().Equals(testDatabase, loadedDatabase));
        }
Exemple #3
0
        public void DeleteTable_TableNoExist_ThrowException()
        {
            AbstractParser xmlParser    = CreateXMLParser();
            Database       testDatabase = ObjectConstructor.CreateDatabaseFull("test6");

            xmlParser.SaveDatabase(testDatabase);
            string randomTableName = "uhhbidsnfisd";

            Assert.IsFalse(xmlParser.ExistTable(testDatabase.databaseName, randomTableName));
            xmlParser.DeleteTable(testDatabase.databaseName, randomTableName);
        }
Exemple #4
0
        public void ExistTable_TableNoExist_ReturnFalse()
        {
            AbstractParser xmlParser    = CreateXMLParser();
            Database       testDatabase = ObjectConstructor.CreateDatabaseFull("test3");

            xmlParser.SaveDatabase(testDatabase);
            string randomTableName = VariousFunctions.GenerateRandomString(6);

            while (testDatabase.ExistTable(randomTableName))
            {
                randomTableName = VariousFunctions.GenerateRandomString(6);
            }
            Assert.IsFalse(xmlParser.ExistTable(testDatabase.databaseName, randomTableName));
        }
Exemple #5
0
        public void ExistTable_TableExist_ReturnTrue()
        {
            AbstractParser xmlParser    = CreateXMLParser();
            Database       testDatabase = ObjectConstructor.CreateDatabaseFull("test2");

            xmlParser.SaveDatabase(testDatabase);
            IEnumerator <ITable> enumerator = testDatabase.GetTableEnumerator();

            if (enumerator.MoveNext())
            {
                Assert.IsTrue(xmlParser.ExistTable(testDatabase.databaseName, enumerator.Current.tableName));
            }
            else
            {
                Assert.Fail("there is no tables idiot!");
            }
        }