public static void AppendException(this DescriptionBuilder descriptionBuilder, Exception ex)
        {
            descriptionBuilder.Append("<div style=\"white-space: nowrap; overflow-x: auto; width: auto; padding: 10px; background-color: rgba(0, 0, 0, 0.1); \">");
            descriptionBuilder.Append($"<h3>Wyjątek {ex.GetType().Name}</h3>");
            descriptionBuilder.Append(ex.Message);
            if (ex.StackTrace != null)
            {
                descriptionBuilder.Append("<h3>StackTrace</h3>");
                descriptionBuilder.Append(ex.Demystify().StackTrace.Replace(" at ", "<br />"));
            }

            if (ex.InnerException != null)
            {
                descriptionBuilder.AppendException(ex.InnerException);
            }

            descriptionBuilder.Append("</div>");
        }
Ejemplo n.º 2
0
        public AzureDevOpsWorkItem MaterializeToBug()
        {
            var azureDevOpsWorkItem = new AzureDevOpsWorkItem
            {
                Project = Project,
                Type    = "Bug",
                Files   = Files.ToArray()
            };

            azureDevOpsWorkItem.SetProperty("/fields/System.Title", Title);
            azureDevOpsWorkItem.SetProperty("/fields/Microsoft.VSTS.TCM.ReproSteps", DescriptionBuilder.ToString());
            if (Tags != null)
            {
                azureDevOpsWorkItem.SetProperty("/fields/System.Tags", String.Join(",", Tags));
            }

            return(azureDevOpsWorkItem);
        }