Microsoft.Protocols.TestManager.Kernel.Utility.GeneratePlainTextReport C# (CSharp) Method

GeneratePlainTextReport() public static method

Convert the list to plain text report
public static GeneratePlainTextReport ( List items, bool showOutcome, SortBy sortby, CaseListItem separator ) : string
items List Case list
showOutcome bool shows test case outcome in the list
sortby SortBy The way of sorting items in the test case list
separator CaseListItem The style of the text file
return string
        public static string GeneratePlainTextReport(List<CaseListItem> items, bool showOutcome, SortBy sortby, CaseListItem.Separator separator)
        {
            if (sortby == SortBy.Name)
            {
                items.Sort((x, y) => { return string.Compare(x.Name, y.Name); });
            }
            else
            {
                items.Sort((x, y) => { return string.Compare(x.Outcome, y.Outcome); });
            }
            StringBuilder sb = new StringBuilder();
            foreach (var i in items)
            {
                sb.AppendLine(i.FormatText(showOutcome, separator));
            }
            return sb.ToString();
        }