private static void WriteUnitTestGroup(UnitTestGroupViewModel group, DocX doc) { Paragraph p; p = doc.InsertParagraph(); p.StyleName = "Heading1"; p.InsertText(group.TestId); p = doc.InsertParagraph(); p.StyleName = "Normal"; p.Italic(); p.Append(string.Format("{0}", group.ParentPath)); foreach (UnitTestObjectViewModel item in group.UnitTestObjects) { if (item is UnitTestGroupViewModel) { DocXExporter.WriteUnitTestGroup(item as UnitTestGroupViewModel, doc); } else if (item is UnitTestViewModel) { DocXExporter.WriteUnitTest(item as UnitTestViewModel, doc); } else { throw new ArgumentException("Unknown unit test object"); } doc.InsertSectionPageBreak(); } }
private BitmapSource GetIcon(UnitTestGroupViewModel item) { return(new BitmapImage(new Uri("pack://application:,,,/Lithnet.Acma.Presentation;component/Resources/UnitTests.png", UriKind.Absolute))); }