/// <summary> /// Creates new test folder /// </summary> /// <param name="testFolder">TDAPIOLELib.TestFolder Object</param> /// <param name="newFolderName">New Folder name</param> /// <returns>TDAPIOLELib.TestFolder Object for new folder</returns> public TDAPIOLELib.TestFolder Create(TDAPIOLELib.TestFolder testFolder, String newFolderName) { TDAPIOLELib.TestFolderFactory testFolderFactory = testFolder.TestFolderFactory; TDAPIOLELib.TestFolder testFolder1 = testFolderFactory.AddItem(System.DBNull.Value); testFolder1["AL_DESCRIPTION"] = newFolderName; testFolder1.Post(); return(testFolder1); }
/// <summary> /// Delete a test plan folder. /// <para/> retruns true if successfull /// </summary> /// <param name="testFolder">TDAPIOLELib.TestFolder Object for the folder to be deleted</param> /// <param name="MovetoUnattached">Move tests under the folder to be deleted to unattached folder</param> /// <returns>true if successfull</returns> public Boolean Delete(TDAPIOLELib.TestFolder testFolder, Boolean MovetoUnattached = false) { TDAPIOLELib.TestFolderFactory testFolderFactory = tDConnection.TestFolderFactory; if (MovetoUnattached == false) { testFolderFactory.RemoveItem(testFolder.ID); } else { testFolderFactory.RemoveItemAndMoveTestsToUnattached(testFolder.ID); } return(true); }
/// <summary> /// Get the TDAPIOLELib.TestFolder object from the folder path /// </summary> /// <param name="folderPath">Path of the test folder</param> /// <returns>TDAPIOLELib.TestFolder Object</returns> public TDAPIOLELib.TestFolder GetFolderObject(String folderPath) { TDAPIOLELib.TestFolderFactory testFolderFactory = tDConnection.TestFolderFactory; TDAPIOLELib.TestFolder testFolder = testFolderFactory.Root; TDAPIOLELib.TDFilter tDFilter; foreach (String foldername in folderPath.Split('\\')) { if (foldername.ToUpper() != "SUBJECT") { testFolderFactory = testFolder.TestFolderFactory; tDFilter = testFolderFactory.Filter; tDFilter["AL_DESCRIPTION"] = foldername; testFolder = tDFilter.NewList()[1]; } } return(testFolder); }