예제 #1
0
        public override TestResult Run(EventListener listener, IFilter filter)
        {
            TestSuiteResult suiteResult = new TestSuiteResult(this, Name);

            listener.SuiteStarted(this);
            long startTime = DateTime.Now.Ticks;

            if (ShouldRun)
            {
                suiteResult.Executed = true;
                DoSetUp(suiteResult);

                RunAllTests(suiteResult, listener, filter);

                DoTearDown(suiteResult);
            }
            else
            {
                suiteResult.NotRun(this.IgnoreReason);
            }

            long   stopTime = DateTime.Now.Ticks;
            double time     = ((double)(stopTime - startTime)) / (double)TimeSpan.TicksPerSecond;

            suiteResult.Time = time;

            listener.SuiteFinished(suiteResult);
            return(suiteResult);
        }
예제 #2
0
 private void MarkTestNotRun(
     Test test, RunState runState, string ignoreReason, TestSuiteResult suiteResult, EventListener listener, ITestFilter filter)
 {
     if (test is TestSuite)
     {
         listener.SuiteStarted(test.TestName);
         TestSuiteResult result = new TestSuiteResult(new TestInfo(test), test.TestName.FullName);
         result.NotRun(runState, ignoreReason, null);
         MarkTestsNotRun(test.Tests, runState, ignoreReason, suiteResult, listener, filter);
         suiteResult.AddResult(result);
         listener.SuiteFinished(result);
     }
     else
     {
         listener.TestStarted(test.TestName);
         TestCaseResult result = new TestCaseResult(new TestInfo(test));
         result.NotRun(runState, ignoreReason, null);
         suiteResult.AddResult(result);
         listener.TestFinished(result);
     }
 }
예제 #3
0
파일: TestSuite.cs 프로젝트: fotisp/conqat
 private void MarkTestNotRun(
     Test test, RunState runState, string ignoreReason, TestSuiteResult suiteResult, EventListener listener, ITestFilter filter)
 {
     if (test is TestSuite)
     {
         listener.SuiteStarted(test.TestName);
         TestSuiteResult result = new TestSuiteResult( new TestInfo(test), test.TestName.FullName);
         result.NotRun( runState, ignoreReason, null );
         MarkTestsNotRun(test.Tests, runState, ignoreReason, suiteResult, listener, filter);
         suiteResult.AddResult(result);
         listener.SuiteFinished(result);
     }
     else
     {
         listener.TestStarted(test.TestName);
         TestCaseResult result = new TestCaseResult( new TestInfo(test) );
         result.NotRun( runState, ignoreReason, null );
         suiteResult.AddResult(result);
         listener.TestFinished(result);
     }
 }
예제 #4
0
		public override TestResult Run(EventListener listener, IFilter filter)
		{
			TestSuiteResult suiteResult = new TestSuiteResult(this, Name);

			listener.SuiteStarted(this);
			long startTime = DateTime.Now.Ticks;

			if ( ShouldRun )
			{
				suiteResult.Executed = true;	
				DoSetUp( suiteResult );

				RunAllTests( suiteResult, listener, filter );

				DoTearDown( suiteResult );
			}
			else
				suiteResult.NotRun(this.IgnoreReason);

			long stopTime = DateTime.Now.Ticks;
			double time = ((double)(stopTime - startTime)) / (double)TimeSpan.TicksPerSecond;
			suiteResult.Time = time;

			listener.SuiteFinished(suiteResult);
			return suiteResult;
		}