/// <summary>
 ///     Constructor
 /// </summary>
 /// <param name="efsSystem">The system for which this frame is built</param>
 public TestReport(EFSSystem efsSystem)
 {
     InitializeComponent();
     reportHandler = new TestsCoverageReportHandler((Dictionary) null);
     TxtB_Path.Text = reportHandler.FileName;
     EFSSystem = efsSystem;
 }
Beispiel #2
0
        /// <summary>
        ///     Creates a section for a given sub-sequence
        /// </summary>
        /// <param name="aSubSequence">A sub-sequence to be displayed</param>
        /// <param name="aReportConfig">The report configuration containing display details</param>
        /// <param name="activatedRules">The list that will contain the rules activated by this sub-sequence</param>
        /// <param name="createPdf">Indicates if the information about this sub-sequence has to be added to the pdf</param>
        public void CreateSubSequenceSection(SubSequence aSubSequence, TestsCoverageReportHandler aReportConfig,
                                             HashSet <RuleCondition> activatedRules, bool createPdf)
        {
            string title = "Sub sequence " + aSubSequence.Name;

            if (createPdf)
            {
                AddSubParagraph(title);
            }

            HashSet <RuleCondition> rules = new HashSet <RuleCondition>();

            aSubSequence.EFSSystem.Runner = new Runner(aSubSequence, false, true);
            foreach (TestCase testCase in aSubSequence.TestCases)
            {
                // SIDE EFFECT:
                // each test case will calculate the list of rules it activates
                // and add them to activatedRules list
                CreateTestCaseSection(aSubSequence.EFSSystem.Runner, testCase, aReportConfig, rules,
                                      createPdf && aReportConfig.AddTestCases);
            }
            activatedRules.UnionWith(rules);

            // now we  can create the table with the current sub sequence statistics
            if (createPdf)
            {
                CreateActivatedRulesSection(title,
                                            rules,
                                            aReportConfig.Dictionary.ImplementedRules,
                                            aReportConfig.AddActivatedRulesInSubSequences);

                CloseSubParagraph();
            }
        }
 /// <summary>
 ///     Constructor: creates a report for the selected frame
 /// </summary>
 /// <param name="aFrame"></param>
 public TestReport(Frame aFrame)
 {
     InitializeComponent();
     _reportHandler = new TestsCoverageReportHandler(aFrame.Dictionary) {Frame = aFrame};
     InitializeCheckBoxes(1);
     TxtB_Path.Text = _reportHandler.FileName;
 }
Beispiel #4
0
        /// <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="aTestCase">Test case 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>
        /// <param name="createPdf">Indicates if the information about this sub-sequence has to be added to the pdf</param>
        public void CreateTestCaseSection(Runner runner, TestCase aTestCase, TestsCoverageReportHandler aReportConfig,
                                          HashSet <RuleCondition> activatedRuleConditions, bool createPdf)
        {
            string title = "Test case " + aTestCase.Name;

            if (createPdf)
            {
                AddSubParagraph(title);

                if (aTestCase.Requirements.Count > 0)
                {
                    AddSubParagraph(title + ": verified requirements:");
                    foreach (ReqRef reqRef in aTestCase.Requirements)
                    {
                        string text = "Requirement " + reqRef.Name;
                        if (!Util.isEmpty(reqRef.Comment))
                        {
                            text = text + " : " + reqRef.Comment;
                        }
                        AddListItem(text);
                    }
                    CloseSubParagraph();
                }
            }

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


            if (createPdf)
            {
                if (aReportConfig.AddSteps)
                {
                    foreach (Step step in aTestCase.Steps)
                    {
                        if (step.SubSteps.Count > 0)
                        {
                            SubStep firstSubStep = step.SubSteps[0] as SubStep;
                            SubStep lastSubStep  = step.SubSteps[step.SubSteps.Count - 1] as SubStep;
                            double  start        = runner.EventTimeLine.GetSubStepActivationTime(firstSubStep);
                            double  end          = runner.EventTimeLine.GetNextSubStepActivationTime(lastSubStep);
                            List <RuleCondition> activatedRules = runner.EventTimeLine.GetActivatedRulesInRange(start,
                                                                                                                end);

                            CreateStepSection(step, activatedRules, aReportConfig);
                        }
                    }
                }


                CreateActivatedRulesSection(title,
                                            runner.EventTimeLine.GetActivatedRules(),
                                            aReportConfig.Dictionary.ImplementedRules,
                                            aReportConfig.AddActivatedRulesInTestCases);

                CloseSubParagraph();
            }
        }
 /// <summary>
 /// Constructor: creates a report for the dictionary
 /// </summary>
 /// <param name="aDictionary"></param>
 public TestReport(DataDictionary.Dictionary aDictionary)
 {
     InitializeComponent();
     EFSSystem = aDictionary.EFSSystem;
     reportHandler = new TestsCoverageReportHandler(aDictionary);
     reportHandler.Dictionary = aDictionary;
     InitializeCheckBoxes(1);
     TxtB_Path.Text = reportHandler.FileName;
 }
Beispiel #6
0
        /// <summary>
        ///     Creates an article with informations about all the paragraphs of the specification
        /// </summary>
        /// <param name="aReportConfig">The report config containing user's choices</param>
        /// <returns></returns>
        public void CreateRequirementCoverageArticle(TestsCoverageReportHandler aReportConfig)
        {
            AddSubParagraph("Test coverage");

            /* This section will contain the statistics on the modeled paragraphs in the dictionary:
             * - their number and percentage */
            GenerateStatistics(aReportConfig.Dictionary, true, false, true, true);
            CloseSubParagraph();
        }
 /// <summary>
 ///     Constructor: creates a report for the dictionary
 /// </summary>
 /// <param name="aDictionary"></param>
 public TestReport(Dictionary aDictionary)
 {
     InitializeComponent();
     _reportHandler = new TestsCoverageReportHandler(aDictionary) {Dictionary = aDictionary};
     InitializeCheckBoxes(1);
     CB_ActivatedRulesInSteps.Checked = false;
     CB_ActivatedRulesInSteps.Enabled = false;
     TxtB_Path.Text = _reportHandler.FileName;
 }
 /// <summary>
 ///     Constructor: creates a report for the selected frame
 /// </summary>
 /// <param name="aFrame"></param>
 public TestReport(Frame aFrame)
 {
     InitializeComponent();
     EFSSystem = aFrame.EFSSystem;
     reportHandler = new TestsCoverageReportHandler(aFrame.Dictionary);
     reportHandler.Frame = aFrame;
     InitializeCheckBoxes(1);
     TxtB_Path.Text = reportHandler.FileName;
 }
Beispiel #9
0
        /// <summary>
        ///     Creates a section for a given step
        /// </summary>
        /// <param name="aStep">The step to be displayed</param>
        /// <param name="activatedRules">The list of rules activated by this step</param>
        /// <param name="aReportConfig">The report config</param>
        private void CreateStepSection(Step aStep, List <RuleCondition> activatedRules,
                                       TestsCoverageReportHandler aReportConfig)
        {
            string title = "Step " + aStep.Name;

            AddSubParagraph(title);

            CreateActivatedRulesSection("",
                                        new HashSet <RuleCondition>(activatedRules),
                                        aReportConfig.Dictionary.ImplementedRules,
                                        aReportConfig.AddActivatedRulesInTestCases);

            CloseSubParagraph();
        }
        /// <summary>
        ///     Creates an article for a given frame
        /// </summary>
        /// <param name="aFrame">Frame to be displayed</param>
        /// <param name="aReportConfig">The report configuration containing display details</param>
        /// <param name="activatedRules">The list that will contain the rules activated by this frame</param>
        /// <returns></returns>
        public void CreateFrameArticle(Frame aFrame, TestsCoverageReportHandler aReportConfig,
            HashSet<RuleCondition> activatedRules)
        {
            string title = "Frame " + aFrame.Name;

            AddSubParagraph(title);

            foreach (SubSequence subSequence in aFrame.SubSequences)
            {
                // SIDE EFFECT:
                // each sub-sequence will calculate the list of rules it activates
                // and add them to activatedRules list
                CreateSubSequenceSection(subSequence, aReportConfig, activatedRules, aReportConfig.AddSubSequences);
            }

            // now we  can create the section containing the activated rules of the frame
            CreateActivatedRulesSection(title,
                activatedRules,
                aReportConfig.Dictionary.ImplementedRules,
                aReportConfig.AddActivatedRulesInFrames);
            CloseSubParagraph();
        }
        /// <summary>
        /// Creates an article for a given frame
        /// </summary>
        /// <param name="aFrame">Frame to be displayed</param>
        /// <param name="aReportConfig">The report configuration containing display details</param>
        /// <param name="activatedRules">The list that will contain the rules activated by this frame</param>
        /// <returns></returns>
        public void CreateFrameArticle(Frame aFrame, TestsCoverageReportHandler aReportConfig, HashSet <RuleCondition> activatedRules)
        {
            AddSubParagraph("Frame " + aFrame.Name);

            foreach (SubSequence subSequence in aFrame.SubSequences)
            {
                // SIDE EFFECT :
                // each test case will calculate the list of rules it activate
                // and add them to activatedRules list
                CreateSubSequenceSection(subSequence, aReportConfig, activatedRules, aReportConfig.AddSubSequences);
            }

            // now we  can create the table with the current sub sequence statistics
            AddSubParagraph("Statistics");
            CreateTable(aFrame.Name,
                        activatedRules,
                        aReportConfig.Dictionary.ImplementedRules,
                        aReportConfig.AddActivatedRulesInFrames,
                        aReportConfig.AddNonCoveredRulesInFrames);
            CloseSubParagraph();
            CloseSubParagraph();
        }
Beispiel #12
0
        /// <summary>
        ///     Creates an article for a given frame
        /// </summary>
        /// <param name="aFrame">Frame to be displayed</param>
        /// <param name="aReportConfig">The report configuration containing display details</param>
        /// <param name="activatedRules">The list that will contain the rules activated by this frame</param>
        /// <returns></returns>
        public void CreateFrameArticle(Frame aFrame, TestsCoverageReportHandler aReportConfig,
                                       HashSet <RuleCondition> activatedRules)
        {
            string title = "Frame " + aFrame.Name;

            AddSubParagraph(title);

            foreach (SubSequence subSequence in aFrame.SubSequences)
            {
                // SIDE EFFECT:
                // each sub-sequence will calculate the list of rules it activates
                // and add them to activatedRules list
                CreateSubSequenceSection(subSequence, aReportConfig, activatedRules, aReportConfig.AddSubSequences);
            }

            // now we  can create the section containing the activated rules of the frame
            CreateActivatedRulesSection(title,
                                        activatedRules,
                                        aReportConfig.Dictionary.ImplementedRules,
                                        aReportConfig.AddActivatedRulesInFrames);
            CloseSubParagraph();
        }
        /// <summary>
        /// Creates a section for a given sub sequence
        /// </summary>
        /// <param name="aFrame">Frame to be displayed</param>
        /// <param name="aReportConfig">The report configuration containing display details</param>
        /// <param name="activatedRules">The list that will contain the rules activated by this sub sequence</param>
        /// <returns></returns>
        public void CreateSubSequenceSection(SubSequence aSubSequence, TestsCoverageReportHandler aReportConfig, HashSet <RuleCondition> activatedRules, bool createPdf)
        {
            AddSubParagraph("Sub sequence " + aSubSequence.Name);

            HashSet <RuleCondition> rules = new HashSet <RuleCondition>();

            aSubSequence.EFSSystem.Runner = new DataDictionary.Tests.Runner.Runner(aSubSequence);
            foreach (TestCase testCase in aSubSequence.TestCases)
            {
                // each test case will calculate the list of rules it activate
                // and add them to activatedRules list
                CreateTestCaseSection(aSubSequence.EFSSystem.Runner, testCase, aReportConfig, rules, createPdf && aReportConfig.AddTestCases);
            }

            // now we  can create the table with the current sub sequence statistics
            CreateTable(aSubSequence.Name,
                        rules,
                        aReportConfig.Dictionary.ImplementedRules,
                        aReportConfig.AddActivatedRulesInSubSequences,
                        aReportConfig.AddNonCoveredRulesInSubSequences);

            activatedRules.UnionWith(rules);
            CloseSubParagraph();
        }
        /// <summary>
        ///     Creates a section for a given step
        /// </summary>
        /// <param name="aStep">The step to be displayed</param>
        /// <param name="activatedRules">The list of rules activated by this step</param>
        /// <param name="aReportConfig">The report config</param>
        private void CreateStepSection(Step aStep, List<RuleCondition> activatedRules,
            TestsCoverageReportHandler aReportConfig)
        {
            string title = "Step " + aStep.Name;
            AddSubParagraph(title);

            CreateActivatedRulesSection("",
                new HashSet<RuleCondition>(activatedRules),
                aReportConfig.Dictionary.ImplementedRules,
                aReportConfig.AddActivatedRulesInTestCases);

            CloseSubParagraph();
        }
 /// <summary>
 ///     Constructor: creates a report for the selected sub sequence
 /// </summary>
 /// <param name="aSubSequence"></param>
 public TestReport(SubSequence aSubSequence)
 {
     InitializeComponent();
     EFSSystem = aSubSequence.EFSSystem;
     reportHandler = new TestsCoverageReportHandler(aSubSequence.Dictionary);
     reportHandler.SubSequence = aSubSequence;
     InitializeCheckBoxes(2);
     TxtB_Path.Text = reportHandler.FileName;
 }
 /// <summary>
 ///     Consctructor: creates a report for a selected test case
 /// </summary>
 /// <param name="aTestCase"></param>
 public TestReport(TestCase aTestCase)
 {
     InitializeComponent();
     EFSSystem = aTestCase.EFSSystem;
     reportHandler = new TestsCoverageReportHandler(aTestCase.Dictionary);
     reportHandler.TestCase = aTestCase;
     InitializeCheckBoxes(3);
     TxtB_Path.Text = reportHandler.FileName;
 }
 /// <summary>
 ///     Consctructor: creates a report for a selected test case
 /// </summary>
 /// <param name="aTestCase"></param>
 public TestReport(TestCase aTestCase)
 {
     InitializeComponent();
     _reportHandler = new TestsCoverageReportHandler(aTestCase.Dictionary) {TestCase = aTestCase};
     InitializeCheckBoxes(3);
     TxtB_Path.Text = _reportHandler.FileName;
 }
        /// <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();
        }
        /// <summary>
        /// Creates a table for a given step of a test
        /// </summary>
        /// <param name="aStep">The step to be displayed</param>
        /// <param name="totalNumberOfRules">The total number of implemented rules in the dictionary</param>
        /// <param name="aReportConfig">The report config</param>
        /// <returns></returns>
        private void CreateStepTable(DataDictionary.Tests.Runner.Runner runner, Step aStep, int totalNumberOfRules, List <RuleCondition> activatedRules, TestsCoverageReportHandler aReportConfig)
        {
            AddParagraph(aStep.Name);

            AddTable(new string[] { "", "Statistics" }, new int[] { 40, 100 });

            double implementedPercentage = (double)((double)activatedRules.Count / (double)totalNumberOfRules) * 100;

            AddRow("Number of activated rules", String.Format("{0} ({1:0.##}%)", activatedRules.Count.ToString(), implementedPercentage));

            if (aReportConfig.AddActivatedRulesInSteps && activatedRules.Count > 0)
            {
                AddRow("Activated rules", null);
                foreach (RuleCondition ruleCondition in activatedRules)
                {
                    AppendToRow(null, ruleCondition.Name);
                }
            }
        }
        /// <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="aTestCase">Test case 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>
        /// <param name="createPdf">Indicates if the information about this sub-sequence has to be added to the pdf</param>
        public void CreateTestCaseSection(Runner runner, TestCase aTestCase, TestsCoverageReportHandler aReportConfig,
            HashSet<RuleCondition> activatedRuleConditions, bool createPdf)
        {
            string title = "Test case " + aTestCase.Name;
            if (createPdf)
            {
                AddSubParagraph(title);

                if (aTestCase.Requirements.Count > 0)
                {
                    AddSubParagraph(title + ": verified requirements:");
                    foreach (ReqRef reqRef in aTestCase.Requirements)
                    {
                        string text = "Requirement " + reqRef.Name;
                        if (!Utils.Utils.isEmpty(reqRef.Comment))
                        {
                            text = text + " : " + reqRef.Comment;
                        }
                        AddListItem(text);
                    }
                    CloseSubParagraph();
                }
            }

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

            if (createPdf)
            {
                if (aReportConfig.AddSteps)
                {
                    foreach (Step step in aTestCase.Steps)
                    {
                        if (step.SubSteps.Count > 0)
                        {
                            SubStep firstSubStep = step.SubSteps[0] as SubStep;
                            SubStep lastSubStep = step.SubSteps[step.SubSteps.Count - 1] as SubStep;
                            double start = runner.EventTimeLine.GetSubStepActivationTime(firstSubStep);
                            double end = runner.EventTimeLine.GetNextSubStepActivationTime(lastSubStep);
                            List<RuleCondition> activatedRules = runner.EventTimeLine.GetActivatedRulesInRange(start,
                                end);

                            CreateStepSection(step, activatedRules, aReportConfig);
                        }
                    }
                }

                CreateActivatedRulesSection(title,
                    runner.EventTimeLine.GetActivatedRules(),
                    aReportConfig.Dictionary.ImplementedRules,
                    aReportConfig.AddActivatedRulesInTestCases);

                CloseSubParagraph();
            }
        }
 /// <summary>
 ///     Constructor: creates a report for the selected sub sequence
 /// </summary>
 /// <param name="aSubSequence"></param>
 public TestReport(SubSequence aSubSequence)
 {
     InitializeComponent();
     _reportHandler = new TestsCoverageReportHandler(aSubSequence.Dictionary) {SubSequence = aSubSequence};
     InitializeCheckBoxes(2);
     TxtB_Path.Text = _reportHandler.FileName;
 }
        /// <summary>
        /// Creates an article with informations about all the paragraphs of the specification
        /// </summary>
        /// <param name="aReportConfig">The report config containing user's choices</param>
        /// <returns></returns>
        public void CreateRequirementCoverageArticle(TestsCoverageReportHandler aReportConfig)
        {
            AddSubParagraph("Test coverage");

            /* This section will contain the statistics on the modeled paragraphs in the dictionary:
             * - their number and percentage */
            GenerateStatistics(aReportConfig.Dictionary, true, false, true, true);
            CloseSubParagraph();
        }
        /// <summary>
        /// Creates a section for a given sub sequence
        /// </summary>
        /// <param name="aFrame">Frame to be displayed</param>
        /// <param name="aReportConfig">The report configuration containing display details</param>
        /// <param name="activatedRules">The list that will contain the rules activated by this sub sequence</param>
        /// <returns></returns>
        public void CreateSubSequenceSection(SubSequence aSubSequence, TestsCoverageReportHandler aReportConfig, HashSet<RuleCondition> activatedRules, bool createPdf)
        {
            AddSubParagraph("Sub sequence " + aSubSequence.Name);

            HashSet<RuleCondition> rules = new HashSet<RuleCondition>();
            aSubSequence.EFSSystem.Runner = new DataDictionary.Tests.Runner.Runner(aSubSequence);
            foreach (TestCase testCase in aSubSequence.TestCases)
            {
                // each test case will calculate the list of rules it activate
                // and add them to activatedRules list
                CreateTestCaseSection(aSubSequence.EFSSystem.Runner, testCase, aReportConfig, rules, createPdf && aReportConfig.AddTestCases);
            }

            // now we  can create the table with the current sub sequence statistics
            CreateTable(aSubSequence.Name,
                        rules,
                        aReportConfig.Dictionary.ImplementedRules,
                        aReportConfig.AddActivatedRulesInSubSequences,
                        aReportConfig.AddNonCoveredRulesInSubSequences);

            activatedRules.UnionWith(rules);
            CloseSubParagraph();
        }
        /// <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();
        }
        /// <summary>
        /// Creates a table for a given step of a test
        /// </summary>
        /// <param name="aStep">The step to be displayed</param>
        /// <param name="totalNumberOfRules">The total number of implemented rules in the dictionary</param>
        /// <param name="aReportConfig">The report config</param>
        /// <returns></returns>
        private void CreateStepTable(DataDictionary.Tests.Runner.Runner runner, Step aStep, int totalNumberOfRules, List<RuleCondition> activatedRules, TestsCoverageReportHandler aReportConfig)
        {
            AddParagraph(aStep.Name);

            AddTable(new string[] { "", "Statistics" }, new int[] { 40, 100 });

            double implementedPercentage = (double)((double)activatedRules.Count / (double)totalNumberOfRules) * 100;
            AddRow("Number of activated rules", String.Format("{0} ({1:0.##}%)", activatedRules.Count.ToString(), implementedPercentage));

            if (aReportConfig.AddActivatedRulesInSteps && activatedRules.Count > 0)
            {
                AddRow("Activated rules", null);
                foreach (RuleCondition ruleCondition in activatedRules)
                {
                    AppendToRow(null, ruleCondition.Name);
                }
            }
        }
        /// <summary>
        ///     Creates a section for a given sub-sequence
        /// </summary>
        /// <param name="aSubSequence">A sub-sequence to be displayed</param>
        /// <param name="aReportConfig">The report configuration containing display details</param>
        /// <param name="activatedRules">The list that will contain the rules activated by this sub-sequence</param>
        /// <param name="createPdf">Indicates if the information about this sub-sequence has to be added to the pdf</param>
        public void CreateSubSequenceSection(SubSequence aSubSequence, TestsCoverageReportHandler aReportConfig,
            HashSet<RuleCondition> activatedRules, bool createPdf)
        {
            string title = "Sub sequence " + aSubSequence.Name;
            if (createPdf)
            {
                AddSubParagraph(title);
            }

            HashSet<RuleCondition> rules = new HashSet<RuleCondition>();
            aSubSequence.EFSSystem.Runner = new Runner(aSubSequence, false, false, true);
            foreach (TestCase testCase in aSubSequence.TestCases)
            {
                // SIDE EFFECT:
                // each test case will calculate the list of rules it activates
                // and add them to activatedRules list
                CreateTestCaseSection(aSubSequence.EFSSystem.Runner, testCase, aReportConfig, rules,
                    createPdf && aReportConfig.AddTestCases);
            }
            activatedRules.UnionWith(rules);

            // now we  can create the table with the current sub sequence statistics
            if (createPdf)
            {
                CreateActivatedRulesSection(title,
                    rules,
                    aReportConfig.Dictionary.ImplementedRules,
                    aReportConfig.AddActivatedRulesInSubSequences);

                CloseSubParagraph();
            }
        }
        /// <summary>
        /// Creates an article for a given frame
        /// </summary>
        /// <param name="aFrame">Frame to be displayed</param>
        /// <param name="aReportConfig">The report configuration containing display details</param>
        /// <param name="activatedRules">The list that will contain the rules activated by this frame</param>
        /// <returns></returns>
        public void CreateFrameArticle(Frame aFrame, TestsCoverageReportHandler aReportConfig, HashSet<RuleCondition> activatedRules)
        {
            AddSubParagraph("Frame " + aFrame.Name);

            foreach (SubSequence subSequence in aFrame.SubSequences)
            {
                // SIDE EFFECT :
                // each test case will calculate the list of rules it activate
                // and add them to activatedRules list
                CreateSubSequenceSection(subSequence, aReportConfig, activatedRules, aReportConfig.AddSubSequences);
            }

            // now we  can create the table with the current sub sequence statistics
            AddSubParagraph("Statistics");
            CreateTable(aFrame.Name,
                        activatedRules,
                        aReportConfig.Dictionary.ImplementedRules,
                        aReportConfig.AddActivatedRulesInFrames,
                        aReportConfig.AddNonCoveredRulesInFrames);
            CloseSubParagraph();
            CloseSubParagraph();
        }
 /// <summary>
 ///     Constructor
 /// </summary>
 public TestReport()
 {
     InitializeComponent();
     _reportHandler = new TestsCoverageReportHandler((Dictionary) null);
     TxtB_Path.Text = _reportHandler.FileName;
 }