Beispiel #1
0
 void setTestResultsCounters(string type, int count)
 {
     TestResultTypes tsType = TestResultTypes.NotTested;
     switch (type) {
         case TestData.TestStatePassed:
             tsType = TestResultTypes.Passed;
             break;
         case TestData.TestStateFailed:
             tsType = TestResultTypes.Failed;
             break;
         case TestData.TestStateKnownIssue:
             tsType = TestResultTypes.PassedWithBadSmell;
             break;
     }
     
     TestRunner.SetTestResultsCounters(
         tsType,
         count,
         ref testResultsPassed,
         ref testResultsFailed,
         ref testResultsAll,
         toolStripStatusLabelPassedCount,
         toolStripStatusLabelFailedCount,
         toolStripStatusLabelAverageCount,
         startTime);
 }
Beispiel #2
0
        //internal static void SetTestResultsCounters(
        public static void SetTestResultsCounters(
            TestResultTypes type,
            int count,
            ref int testResultsPassed,
            ref int testResultsFailed,
            ref int testResultsAll,
            System.Windows.Forms.ToolStripStatusLabel passed,
            System.Windows.Forms.ToolStripStatusLabel failed,
            System.Windows.Forms.ToolStripStatusLabel average,
            DateTime startTime)
        {
            switch (type)
            {
            case TestResultTypes.Passed:
                testResultsPassed += count;
                if (passed != null)
                {
                    passed.Text =
                        testResultsPassed.ToString();
                }
                break;

            case TestResultTypes.Failed:
                testResultsFailed += count;
                if (failed != null)
                {
                    failed.Text =
                        testResultsFailed.ToString();
                }
                break;

            case TestResultTypes.NotTested:

                break;

            case TestResultTypes.PassedWithBadSmell:

                break;

            default:
                //throw new Exception("Invalid value for TestResultTypes");case TestResultTypes.Passed:
                break;
            }
            testResultsAll++;
            string trps =
                (testResultsAll / (DateTime.Now - startTime).TotalSeconds).ToString();

            average.Text =
                trps.Substring(0, trps.IndexOf(".") + 2) +
                " trps";
        }
Beispiel #3
0
 //internal static void SetTestResultsCounters(
 public static void SetTestResultsCounters(
     TestResultTypes type, 
     int count,
     ref int testResultsPassed,
     ref int testResultsFailed,
     ref int testResultsAll,
     System.Windows.Forms.ToolStripStatusLabel passed,
     System.Windows.Forms.ToolStripStatusLabel failed,
     System.Windows.Forms.ToolStripStatusLabel average,
     System.DateTime startTime)
 {
     switch (type) {
         case TestResultTypes.Passed:
             testResultsPassed += count;
             if (passed != null) {
                 passed.Text = 
                     testResultsPassed.ToString();
             }
             break;
         case TestResultTypes.Failed:
             testResultsFailed += count;
             if (failed != null) {
                 failed.Text = 
                     testResultsFailed.ToString();
             }
             break;
         case TestResultTypes.NotTested:
             
             break;
         case TestResultTypes.PassedWithBadSmell:
             
             break;
         default:
             //throw new Exception("Invalid value for TestResultTypes");case TestResultTypes.Passed:
             break;
     }
     testResultsAll++;
     string trps = 
        (testResultsAll / (System.DateTime.Now - startTime).TotalSeconds).ToString();
     average.Text = 
         trps.Substring(0, trps.IndexOf(".") + 2) +
         " trps";
 }