예제 #1
0
        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();
            }
        }
예제 #2
0
 private BitmapSource GetIcon(UnitTestGroupViewModel item)
 {
     return(new BitmapImage(new Uri("pack://application:,,,/Lithnet.Acma.Presentation;component/Resources/UnitTests.png", UriKind.Absolute)));
 }