Exemple #1
0
 public virtual void NotifyTestEvent(TestResultEvent args)
 {
     if (TestResultEventHandler != null)
     {
         TestResultEventHandler(this, args);
     }
 }
Exemple #2
0
        public void report(TestResultEvent data)
        {
            bool IsframeworkMethod = data.Method.IsFrameworkMethod;

            if (!(IsframeworkMethod ||
                  data.Nature == RESULT_TYPE.TEST_STARTED ||
                  data.Nature == RESULT_TYPE.SUCCESS))
            {
                Console.WriteLine("" + data.Nature + " " + data.Method.Name);
            }
            switch (data.Nature)
            {
            case RESULT_TYPE.SUCCESS:
                if (!IsframeworkMethod)
                {
                    passed.Add(data);
                }
                break;

            case RESULT_TYPE.FAILED_ASSERTION:
                Console.WriteLine("\t" + data.Error.Message);
                if (!IsframeworkMethod)
                {
                    failed.Add(data);
                }
                break;

            case RESULT_TYPE.TEST_STARTED:
                break;

            case RESULT_TYPE.FAILED_EXECUTION:
                if (data.Error != null)
                {
                    printStackTrace(data.Error);
                }
                errored.Add(data);
                break;

            case RESULT_TYPE.FAILED_SETUP:
            case RESULT_TYPE.FAILED_DEFINITION_MULTIPLE_SETUP_METHOD:
            case RESULT_TYPE.FAILED_DEFINITION_NO_CONSTRUCTOR:
            case RESULT_TYPE.FAILED_DEFINITION_NO_TESTCASE:
            case RESULT_TYPE.NO_RUN_FAILED_SETUP:
            case RESULT_TYPE.NO_RUN_FAILED_ONE_TIME_SETUP:
                if (!IsframeworkMethod)
                {
                    didNotRun.Add(data);
                }
                break;

            default:
                Console.WriteLine("***WARN: Not handled " + data.Nature);
                break;
            }
        }