private static void WriteUtInfo(TextWriter textWriter, UTInfo utInfo, int tabCount) { textWriter.WriteLine("{0}{1}", new string('\t', tabCount), utInfo.Description); var space = new string('\t', tabCount + 1); if (utInfo.WhenList.Any()) { utInfo.WhenList.ForEach(b => textWriter.WriteLine("{0}{1}", space, b)); } utInfo.ThenList.ForEach(b => textWriter.WriteLine("{0}{1}", space, b)); utInfo.Children.ForEach( s => { WriteUtInfo(textWriter, s, tabCount + 1); textWriter.WriteLine(); }); if (utInfo.Children.Count == 0) { textWriter.WriteLine(); } }
private static int GetElementCount <T>(UTInfo utInfo, Func <UTInfo, List <T> > func) { return(func(utInfo).Count + utInfo.Children.Sum(i => GetElementCount(i, func))); }