Пример #1
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);
        }
Пример #2
0
        public void DeleteTable_TableExist_DeleteThen()
        {
            AbstractParser xmlParser    = CreateXMLParser();
            Database       testDatabase = ObjectConstructor.CreateDatabaseFull("test5");

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

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