コード例 #1
0
        private static void WriteUnitTest(UnitTestViewModel test, DocX doc)
        {
            Paragraph p;

            p           = doc.InsertParagraph();
            p.StyleName = "Heading1";
            p.InsertText(test.TestId);

            p           = doc.InsertParagraph();
            p.StyleName = "Normal";
            p.Italic();
            p.Append(string.Format("{0}", test.ParentPath));

            foreach (var step in test.Steps)
            {
                if (step is UnitTestStepObjectCreationViewModel)
                {
                    DocXExporter.WriteUnitTestStepObjectCreation(step as UnitTestStepObjectCreationViewModel, doc);
                }
                else if (step is UnitTestStepObjectModificationViewModel)
                {
                    DocXExporter.WriteUnitTestStepObjectModification(step as UnitTestStepObjectModificationViewModel, doc);
                }
                else if (step is UnitTestStepObjectEvaluationViewModel)
                {
                    DocXExporter.WriteUnitTestStepObjectEvaluation(step as UnitTestStepObjectEvaluationViewModel, doc);
                }
                else
                {
                    throw new ArgumentException("Unknown unit test step object");
                }
            }
        }
コード例 #2
0
ファイル: IconProvider.cs プロジェクト: ryannewington/acma
 private BitmapSource GetIcon(UnitTestViewModel item)
 {
     return(new BitmapImage(new Uri("pack://application:,,,/Lithnet.Acma.Presentation;component/Resources/UnitTest.png", UriKind.Absolute)));
 }