Exemplo n.º 1
0
        public void CreateSampleData()
        {
            WorkItem workItem1;
            WorkItem workItem2;
            WorkItem workItem3;
            WorkItem newWorkItem;

            using (new ClientSampleHttpLoggerOutputSuppression())
            {
                WorkItemsSample witSample = new WorkItemsSample();
                witSample.Context = this.Context;
                newWorkItem       = witSample.CreateWorkItem("Sample work item for comments", "Task");

                _id = Convert.ToInt32(newWorkItem.Id);

                workItem1 = witSample.CreateWorkItem("Sample work item for comments #1", "Task");
                workItem2 = witSample.CreateWorkItem("Sample work item for comments #2", "Task");
                workItem3 = witSample.CreateWorkItem("Sample work item for comments #3", "Task");

                _ids = new int[] { Convert.ToInt32(workItem1.Id), Convert.ToInt32(workItem2.Id), Convert.ToInt32(workItem3.Id) };
            }
        }
Exemplo n.º 2
0
        public WorkItemComment GetSingleWorkItemComment()
        {
            WorkItem newWorkItem;

            using (new ClientSampleHttpLoggerOutputSuppression())
            {
                WorkItemsSample witSample = new WorkItemsSample();
                witSample.Context = this.Context;
                newWorkItem       = witSample.CreateWorkItem("Sample work item for comments", "Task");
                Context.SetValue <WorkItem>("$newWorkItem", newWorkItem);
            }

            int id = Convert.ToInt32(newWorkItem.Id);

            VssConnection connection = Context.Connection;
            WorkItemTrackingHttpClient workItemTrackingClient = connection.GetClient <WorkItemTrackingHttpClient>();

            WorkItemComment result = workItemTrackingClient.GetCommentAsync(id, 1).Result;

            Console.WriteLine("Revision: {0}", result.Revision);
            Console.WriteLine("Text: {0}", result.Text);

            return(result);
        }