Exemplo n.º 1
0
        public void TestCreateIssue()
        {
            string constantValue = string.Format("{0} at {1} UTC", DateTime.UtcNow.ToLongDateString(), DateTime.UtcNow.ToLongTimeString());

            //This is to list fields and their values for bug creation
            IEnumerable <JsonPatchItem> bugItemValues = FieldValueMap.CreateInstance(Maps.TFSEnumToJsonMap)
                                                        .Append(FieldName.Title, string.Format("Test Issue Created via API on '{0}'", constantValue))
                                                        .Append(FieldName.AssignedTo, "Bankey Sharma")
                                                        .Append(FieldName.AreaPath, "area-path-value")
                                                        .Append(FieldName.IterationPath, "iteration-value")
                                                        .Append(FieldName.Tags, "available-tags")
                                                        .Append(FieldName.Description, string.Format("Sample description steps.\r\n{0}", constantValue))
                                                        .Append(FieldName.Priority, "1")
                                                        .Append(FieldName.Severity, "2 - High")
                                                        .Build();

            azureContext.CreateIssue(bugItemValues);
        }