コード例 #1
0
ファイル: TestSuite.cs プロジェクト: montecarlo1/Projects
        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
ファイル: TestSuite.cs プロジェクト: alesliehughes/olive
		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;
		}