当前位置: 首页>>代码示例>>C#>>正文


C# DataDictionary.RunUntilStep方法代码示例

本文整理汇总了C#中DataDictionary.RunUntilStep方法的典型用法代码示例。如果您正苦于以下问题:C# DataDictionary.RunUntilStep方法的具体用法?C# DataDictionary.RunUntilStep怎么用?C# DataDictionary.RunUntilStep使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在DataDictionary的用法示例。


在下文中一共展示了DataDictionary.RunUntilStep方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateTestCaseSection

        /// <summary>
        /// Creates a section for a given test case
        /// </summary>
        /// <param name="runner">The runner to be used to execute the tests</param>
        /// <param name="aFrame">Frame to be displayed</param>
        /// <param name="aReportConfig">The report configuration containing display details</param>
        /// <param name="activatedRuleConditions">The list that will contain the rules activated by this test case</param>
        /// <returns></returns>
        public void CreateTestCaseSection(DataDictionary.Tests.Runner.Runner runner, TestCase aTestCase, TestsCoverageReportHandler aReportConfig, HashSet<RuleCondition> activatedRuleConditions, bool createPdf)
        {
            AddSubParagraph("Test case " + aTestCase.Name);

            if (aTestCase.Requirements.Count > 0)
            {
                AddParagraph("This test case verifies the following requirements");
                foreach (DataDictionary.ReqRef reqRef in aTestCase.Requirements)
                {
                    string text = "Requirement " + reqRef.Name;
                    if (!Utils.Utils.isEmpty(reqRef.Comment))
                    {
                        text = text + " : " + reqRef.Comment;
                    }
                    AddListItem(text);
                }
            }

            runner.RunUntilStep(null);
            activatedRuleConditions.UnionWith(runner.EventTimeLine.GetActivatedRules());

            string title = "Test case " + aTestCase.Name;
            CreateTable(title,
                        runner.EventTimeLine.GetActivatedRules(),
                        aReportConfig.Dictionary.ImplementedRules,
                        aReportConfig.AddActivatedRulesInTestCases,
                        aReportConfig.AddNonCoveredRulesInTestCases);

            if (createPdf && aReportConfig.AddSteps)
            {
                foreach (Step step in aTestCase.Steps)
                {
                    if (step.SubSteps.Count > 0)
                    {
                        AddSubParagraph(String.Format("Step {0}", step.Name));

                        DataDictionary.Tests.SubStep firstSubStep = step.SubSteps[0] as DataDictionary.Tests.SubStep;
                        DataDictionary.Tests.SubStep lastSubStep = step.SubSteps[step.SubSteps.Count - 1] as DataDictionary.Tests.SubStep;
                        double start = runner.EventTimeLine.GetSubStepActivationTime(firstSubStep);
                        double end = runner.EventTimeLine.GetNextSubStepActivationTime(lastSubStep);
                        List<RuleCondition> activatedRules = runner.EventTimeLine.GetActivatedRulesInRange(start, end);

                        CreateStepTable(runner, step, aTestCase.Dictionary.ImplementedRules.Count, activatedRules, aReportConfig);
                        if (aReportConfig.AddLog)
                        {
                            List<DataDictionary.Tests.Runner.Events.ModelEvent> events = runner.EventTimeLine.GetEventsInRange((uint)start, (uint)end);
                            foreach (ModelEvent ev in events)
                            {
                                AddCode(ev.ToString());
                            }
                        }
                        CloseSubParagraph();
                    }
                }
            }
            CloseSubParagraph();
        }
开发者ID:Assmann-Siemens,项目名称:ERTMSFormalSpecs,代码行数:65,代码来源:TestsCoverageReport.cs


注:本文中的DataDictionary.RunUntilStep方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。