public TestOutcome CreateNote(string path) { TestOutcome outcome = new TestOutcome(); outcome.moduleName = "Folders"; outcome.methodName = "FolderNote"; string noteName = "Note-" + System.DateTime.Now.ToString("G", CultureInfo.CreateSpecificCulture("en-US")).Replace('/', '-').Replace(':', '_'); try { FoldersApi foldersApi = new FoldersApi(_url); Folder containingFolder = foldersApi.FolderFind(_session.SessionId, path); ProjectContent content = new ProjectContent(@" <h1>A note</h1> <p>This is a new note</p> "); Folder folder = foldersApi.FolderNote(_session.SessionId, containingFolder.Id, "ProjectContent", noteName, content); Console.WriteLine(folder.Description); outcome.outcome = "Success"; return(outcome); } catch (Exception ex) { outcome.outcome = ex.Message; return(outcome); } }
public TestOutcome GetFolderByPath(string path) { TestOutcome outcome = new TestOutcome(); outcome.moduleName = "Folders"; outcome.methodName = "FolderFind"; try { FoldersApi foldersApi = new FoldersApi(_url); Folder folder = foldersApi.FolderFind(_session.SessionId, path); Console.WriteLine(folder.Description); outcome.outcome = "Success"; return(outcome); } catch (Exception ex) { outcome.outcome = ex.Message; return(outcome); } }
public TestOutcome UpdateFolder(string path) { TestOutcome outcome = new TestOutcome(); outcome.moduleName = "Folders"; outcome.methodName = "FolderUpdate"; try { FoldersApi foldersApi = new FoldersApi(_url); Folder folder = foldersApi.FolderFind(_session.SessionId, path); folder.Description = "this is a new description"; //! CMillshttps://edge-ka.atlassian.net/browse/BR4M2-693 means you have to set folder name to null may want to take this if the bug if fixed folder.Name = String.Empty; Folder upFolder = foldersApi.FolderUpdate(_session.SessionId, folder.Id, folder); Console.WriteLine(upFolder.Description); outcome.outcome = "Success"; return(outcome); } catch (Exception ex) { outcome.outcome = ex.Message; return(outcome); } }