Exemplo n.º 1
0
        /// <summary>
        /// run all automation
        /// </summary>
        private void RunAll()
        {
            if (Data != null)
            {
                // create new report
                IReporter reporter = Reporter.NewInstance;
                reporter.BeginReport(Name, Data.Name);

                while (Data.MoveNext() && !IsStopped)
                {
                    reporter.BeginDataRow(Data.CurrentRowId);

                    StartScript.Restart();
                    Scripts.Push(StartScript);

                    Run(reporter);

                    reporter.EndDataRow(Data.CurrentRowId);
                }

                reporter.EndReport();
            }
            else
            {
                // create new report
                IReporter reporter = Reporter.NewInstance;
                reporter.BeginReport(Name + Constants.ReportText.ReportNameSuffix, null);

                StartScript.Restart();
                Scripts.Push(StartScript);
                Run(reporter);

                reporter.EndReport();
            }

            if (IsStopped && Interupted != null)
            {
                Interupted(this);
            }

            if (Ended != null)
            {
                Ended(this);
            }
        }