Example #1
0
        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);
            }
        }