Exemplo n.º 1
0
 /// <summary>Called when the whole test suite has ended.</summary>
 public void EndTestSuite(TestResultExtra result) {
     if (Verbose) {
         Console.WriteLine(Prefix + "------------------------------------------");
     }
     if (result.WasSuccessful) {
         Console.WriteLine(Prefix + "{0} tests: ALL SUCCESSFUL", result.RunCount);
     } else {
         Console.WriteLine(Prefix + "{0} tests: FAILURES: {1} ERRORS: {2}", result.RunCount, result.FailureCount, result.ErrorCount);
     }
 }
Exemplo n.º 2
0
 /// <summary>Called when the whole test suite has ended.</summary>
 public void EndTestSuite(TestResultExtra result) {
     Writer.WriteLine("------------------------------------------");
     if (result.WasSuccessful) {
         Writer.WriteLine("{0} tests: ALL SUCCESSFUL", result.RunCount);
     } else {
         Writer.WriteLine("{0} tests: FAILURES: {1} ERRORS: {2}",
             result.RunCount, result.FailureCount, result.ErrorCount);
     }
     Writer.Flush();
     Writer.Close();
 }
Exemplo n.º 3
0
        /// <summary>
        /// Called when the whole test suite has ended.
        /// </summary>
        public void EndTestSuite(TestResultExtra result) {
            _suiteElement.SetAttribute(AttributeTests , result.RunCount.ToString(NumberFormatInfo.InvariantInfo));
            double time = result.RunTime;
            time /= 1000D; 
            _suiteElement.SetAttribute(AttributeTime, time.ToString("#####0.000", NumberFormatInfo.InvariantInfo));
            _document.AppendChild(_suiteElement);

            _suiteElement.SetAttribute(AttributeErrors , result.ErrorCount.ToString(NumberFormatInfo.InvariantInfo)); 
            _suiteElement.SetAttribute(AttributeFailures , result.FailureCount.ToString(NumberFormatInfo.InvariantInfo));
            
            // Send all output to here
            _document.Save(Writer);
            Writer.Flush();
            Writer.Close();
        }
Exemplo n.º 4
0
 /// <summary>Called when the whole test suite has ended.</summary>
 public void EndTestSuite(TestResultExtra result)
 {
     if (Verbose)
     {
         Console.WriteLine(Prefix + "------------------------------------------");
     }
     if (result.WasSuccessful)
     {
         Console.WriteLine(Prefix + "{0} tests: ALL SUCCESSFUL", result.RunCount);
     }
     else
     {
         Console.WriteLine(Prefix + "{0} tests: FAILURES: {1} ERRORS: {2}", result.RunCount, result.FailureCount, result.ErrorCount);
     }
 }
Exemplo n.º 5
0
 /// <summary>Called when the whole test suite has ended.</summary>
 public void EndTestSuite(TestResultExtra result)
 {
     Writer.WriteLine("------------------------------------------");
     if (result.WasSuccessful)
     {
         Writer.WriteLine("{0} tests: ALL SUCCESSFUL", result.RunCount);
     }
     else
     {
         Writer.WriteLine("{0} tests: FAILURES: {1} ERRORS: {2}",
                          result.RunCount, result.FailureCount, result.ErrorCount);
     }
     Writer.Flush();
     Writer.Close();
 }
        /// <summary>
        /// Called when the whole test suite has ended.
        /// </summary>
        public void EndTestSuite(TestResultExtra result)
        {
            _suiteElement.SetAttribute(AttributeTests, result.RunCount.ToString(NumberFormatInfo.InvariantInfo));
            double time = result.RunTime;

            time /= 1000D;
            _suiteElement.SetAttribute(AttributeTime, time.ToString("#####0.000", NumberFormatInfo.InvariantInfo));
            _document.AppendChild(_suiteElement);

            _suiteElement.SetAttribute(AttributeErrors, result.ErrorCount.ToString(NumberFormatInfo.InvariantInfo));
            _suiteElement.SetAttribute(AttributeFailures, result.FailureCount.ToString(NumberFormatInfo.InvariantInfo));

            // Send all output to here
            _document.Save(Writer);
            Writer.Flush();
            Writer.Close();
        }
Exemplo n.º 7
0
        /// <summary>
        /// Runs a Suite extracted from a TestCase subclass.
        /// </summary>
        public void Run(string logPrefix, bool verbose)
        {
            CreateFormatters(_nunittest, logPrefix, verbose);

            _result = new TestResultExtra();

            _result.AddListener(this);
            long startTime = System.DateTime.Now.Ticks;

            // Handle start
            OnStartTestSuite();

            _suite.Run(_result);

            // finished test
            long endTime = System.DateTime.Now.Ticks;
            long runTime = (endTime-startTime) / 10000;

            _result.RunTime = runTime;

            // Handle completion
            OnEndTestSuite();

            if (_result.WasSuccessful == false) {
                if (_result.ErrorCount != 0) {
                    _resultCode = RunnerResult.Errors;
                } else if (_result.FailureCount !=0) {
                    _resultCode = RunnerResult.Failures;
                }
            }
        }