コード例 #1
0
        public void UpdateTableName_WithValidDatabasePath_RenamesTableInSpecifiedDatabase()
        {
            MainTreeHandler.UpdateTableName("Table", "NewTable", DATABASEPATH1);

            var result = TreeSearcher.DatabaseHoldsItem <TableFolderItem>(testTree, "NewTable", DATABASEPATH1);

            Assert.IsTrue(result);
        }
コード例 #2
0
        public void UpdateTableName_WithValidDatabasePath_DatabaseDoesNotContainOldItemAnymore()
        {
            MainTreeHandler.UpdateTableName("Table", "NewTable", DATABASEPATH1);

            var result = TreeSearcher.DatabaseHoldsItem <TableFolderItem>(testTree, "Table", DATABASEPATH1);

            Assert.IsFalse(result);
        }
コード例 #3
0
 private void RenameTable()
 {
     using (var tableHandler = new TableHandler(originalElement.DatabasePath))
     {
         tableHandler.RenameTable(originalElement.DisplayName, NewName);
         MainTreeHandler.UpdateTableName(originalElement.DisplayName, NewName, originalElement.DatabasePath);
     }
 }
コード例 #4
0
 public void UpdateTableName_WithInvalidOldName_DoesNotThrowException()
 {
     Assert.DoesNotThrow(
         () => MainTreeHandler.UpdateTableName("InvalidOldName", "NewName", DATABASEPATH1));
 }