Beispiel #1
0
        public override string ToString()
        {
            if (Text != null && !string.IsNullOrEmpty(Text.Div))
            {
                return(Text.Div);
            }

            var textBuilder = new StringBuilder();

            if (Success)
            {
                textBuilder.Append("Overall result: SUCCESS");
            }
            else
            {
                textBuilder.AppendFormat("Overall result: FAILURE ({0} errors and {1} warnings)", Errors + Fatals, Warnings);
            }
            textBuilder.AppendLine();

            if (Issue.Any())
            {
                foreach (var issue in Issue)
                {
                    textBuilder.Append(' ', issue.HierarchyLevel * 2);
                    textBuilder.AppendLine();
                    issue.ToStringBuilder(textBuilder);
                }
            }

            return(textBuilder.ToString());
        }
Beispiel #2
0
        public override string ToString()
        {
            if (Text != null && !string.IsNullOrEmpty(Text.Div))
            {
                return(Text.Div);
            }

            var text = Success ?
                       "Overall result: SUCCESS" + Environment.NewLine :
                       $"Overall result: FAILURE ({Errors + Fatals} errors and {Warnings} warnings)" + Environment.NewLine;

            if (Issue.Any())
            {
                text += Environment.NewLine;

                foreach (var issue in Issue)
                {
                    var indent = new string(' ', issue.HierarchyLevel * 2);
                    text += indent + issue.ToString() + Environment.NewLine;
                }
            }

            return(text);
        }