예제 #1
0
        public void UpdateViewName_WithValidDatabasePath_RenamesViewInSpecifiedDatabase()
        {
            MainTreeHandler.UpdateViewName("View", "NewView", DATABASEPATH1);

            var result = TreeSearcher.DatabaseHoldsItem <ViewFolderItem>(testTree, "NewView", DATABASEPATH1);

            Assert.IsTrue(result);
        }
예제 #2
0
        public void UpdateViewName_WithValidDatabasePath_DatabaseDoesNotContainOldItemAnymore()
        {
            MainTreeHandler.UpdateViewName("View", "NewView", DATABASEPATH1);

            var result = TreeSearcher.DatabaseHoldsItem <ViewFolderItem>(testTree, "View", DATABASEPATH1);

            Assert.IsFalse(result);
        }
예제 #3
0
 private void RenameView()
 {
     using (var viewHandler = new ViewHandler(originalElement.DatabasePath))
     {
         viewHandler.UpdateViewName(originalElement.DisplayName, NewName);
         MainTreeHandler.UpdateViewName(originalElement.DisplayName, NewName, originalElement.DatabasePath);
     }
 }
예제 #4
0
 public void UpdateViewName_WithInvalidOldName_DoesNotThrowException()
 {
     Assert.DoesNotThrow(
         () => MainTreeHandler.UpdateViewName("InvalidOldName", "NewName", DATABASEPATH1));
 }