예제 #1
0
        private bool RunOneTestSuite(BaseTestSuite testSuite)
        {
            bool      result        = true;
            string    testSuiteName = testSuite.SuiteName;
            Stopwatch stopWatch     = new Stopwatch();

            stopWatch.Start();

            try
            {
                logger.Info("Executing TestSuite: " + testSuite);

                result = testSuite.Execute();
                if (!result)
                {
                    logger.Error("Error in running test suite: " + testSuiteName);
                }
                else
                {
                    logger.Info("Successful in running test suite: " + testSuiteName);
                }
            }
            catch (Exception e)
            {
                result = false;
                logger.Error("Error while running test suite: " + testSuiteName + ". Exception: " + e);
            }

            MetricsHelper.PushTestSuiteMetric(Convert.ToInt64(stopWatch.Elapsed.TotalMinutes), testSuiteName, result.ToString());

            return(result);
        }