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!"); } }
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); }
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)); }