当前位置: 首页>>代码示例>>C#>>正文


C# EventListener.SuiteStarted方法代码示例

本文整理汇总了C#中EventListener.SuiteStarted方法的典型用法代码示例。如果您正苦于以下问题:C# EventListener.SuiteStarted方法的具体用法?C# EventListener.SuiteStarted怎么用?C# EventListener.SuiteStarted使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在EventListener的用法示例。


在下文中一共展示了EventListener.SuiteStarted方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Run

        public override TestResult Run(EventListener listener, ITestFilter filter)
        {
            listener.SuiteStarted(this.TestName);

            var suiteListener = new MuteSuiteListener(listener);

            var fixtureResult = base.Run(suiteListener, TestFilter.Empty);
            var testResult = fixtureResult.Results[0] as TestResult;

            if (testResult != null)
            {
                if (testResult.IsFailure || testResult.IsError)
                {
                    fixtureResult.SetResult(testResult.ResultState,
                                            testResult.Message,
                                            testResult.StackTrace);
                }
                if (testResult.IsSuccess)
                {
                    fixtureResult.Success();
                }
            }

            listener.SuiteFinished(fixtureResult);
            return fixtureResult;
        }
开发者ID:concordion,项目名称:concordion.net,代码行数:26,代码来源:ConcordionTestFixture.cs

示例2: Run

        public override TestResult Run(EventListener listener, ITestFilter filter)
        {
            using (new TestContext())
            {
                TestSuiteResult suiteResult = new TestSuiteResult(new TestInfo(this), TestName.Name);

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

                switch (this.RunState)
                {
                    case RunState.Runnable:
                    case RunState.Explicit:
                        suiteResult.RunState = RunState.Executed;
                        DoOneTimeSetUp(suiteResult);
                        if (suiteResult.IsFailure)
                            MarkTestsFailed(Tests, suiteResult, listener, filter);
                        else
                        {
                            try
                            {
                                RunAllTests(suiteResult, listener, filter);
                            }
                            finally
                            {
                                DoOneTimeTearDown(suiteResult);
                            }
                        }
                        break;

                    case RunState.Skipped:
                        suiteResult.Skip(this.IgnoreReason);
                        MarkTestsNotRun(Tests, RunState.Skipped, IgnoreReason, suiteResult, listener, filter);
                        break;

                    default:
                    case RunState.Ignored:
                    case RunState.NotRunnable:
                        suiteResult.Ignore(this.IgnoreReason);
                        MarkTestsNotRun(Tests, RunState.Ignored, IgnoreReason, suiteResult, listener, filter);
                        break;
                }

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

                listener.SuiteFinished(suiteResult);
                return suiteResult;
            }
        }
开发者ID:mbsky,项目名称:dotnetmarcheproject,代码行数:51,代码来源:RandomizerTestFixture.cs

示例3: MarkTestNotRun

 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);
     }
 }
开发者ID:fotisp,项目名称:conqat,代码行数:21,代码来源:TestSuite.cs

示例4: MarkTestFailed

 private void MarkTestFailed(
     Test test, TestSuiteResult suiteResult, EventListener listener, ITestFilter filter)
 {
     if (test is TestSuite)
     {
         listener.SuiteStarted(test.TestName);
         TestSuiteResult result = new TestSuiteResult( new TestInfo(test), test.TestName.FullName);
         string msg = string.Format( "Parent SetUp failed in {0}", this.FixtureType.Name );
         result.Failure(msg, null, FailureSite.Parent);
         MarkTestsFailed(test.Tests, suiteResult, listener, filter);
         suiteResult.AddResult(result);
         listener.SuiteFinished(result);
     }
     else
     {
         listener.TestStarted(test.TestName);
         TestCaseResult result = new TestCaseResult( new TestInfo(test) );
         string msg = string.Format( "TestFixtureSetUp failed in {0}", this.FixtureType.Name );
         result.Failure(msg, null, FailureSite.Parent);
         suiteResult.AddResult(result);
         listener.TestFinished(result);
     }
 }
开发者ID:fotisp,项目名称:conqat,代码行数:23,代码来源:TestSuite.cs

示例5: Send

		public override void Send( EventListener listener )
		{
			listener.SuiteStarted( this.suiteName );
		}
开发者ID:Phaiax,项目名称:dotnetautoupdate,代码行数:4,代码来源:EventQueue.cs

示例6: Run

		public override TestResult Run(EventListener listener, ITestFilter filter)
		{
            listener.SuiteStarted(this.TestName);
#if CLR_2_0 || CLR_4_0
            long startTime = Stopwatch.GetTimestamp();
#else
            long startTime = DateTime.Now.Ticks;
#endif

			TestResult suiteResult = this.RunState == RunState.Runnable || this.RunState == RunState.Explicit
				? RunSuiteInContext(listener, filter)
				: SkipSuite(listener, filter);
			
#if CLR_2_0 || CLR_4_0
            long stopTime = Stopwatch.GetTimestamp();
            double time = ((double)(stopTime - startTime)) / (double)Stopwatch.Frequency;
#else
            long stopTime = DateTime.Now.Ticks;
            double time = ((double)(stopTime - startTime)) / (double)TimeSpan.TicksPerSecond;
#endif
            suiteResult.Time = time;

            listener.SuiteFinished(suiteResult);
            return suiteResult;
		}
开发者ID:kobida,项目名称:nunitv2,代码行数:25,代码来源:TestSuite.cs

示例7: Run

        public override TestResult Run(EventListener listener, ITestFilter filter)
        {
            using( new TestContext() )
            {
                TestResult suiteResult = new TestResult( this );

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

                switch (this.RunState)
                {
                    case RunState.Runnable:
                    case RunState.Explicit:
                        if (RequiresThread || ApartmentState != GetCurrentApartment())
                            new TestSuiteThread(this).Run(suiteResult, listener, filter);
                        else
                            Run(suiteResult, listener, filter);
                        break;

                    default:
                    case RunState.Skipped:
                        SkipAllTests(suiteResult, listener, filter);
                        break;
                    case RunState.NotRunnable:
                        MarkAllTestsInvalid( suiteResult, listener, filter);
                        break;
                    case RunState.Ignored:
                        IgnoreAllTests(suiteResult, listener, filter);
                        break;
                }

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

                listener.SuiteFinished(suiteResult);
                return suiteResult;
            }
        }
开发者ID:julianhaslinger,项目名称:shouldly,代码行数:39,代码来源:TestSuite.cs

示例8: Run

 public override TestResult Run(EventListener listener, ITestFilter filter)
 {
     listener.SuiteStarted(TestName);
     var result = new TestResult(this);
     try {
         ITestResult resultAdapter = new NUnitTestResultAdapter(result);
         fixture.WithInitialized(_ => {
             foreach(var item in Tests.Cast<Test>().Where(filter.Pass).Select(x => x.Run(listener, filter)))
      						result.AddResult(item);
             }, ex => {
                 resultAdapter.BeforeFailure(ex);
                 foreach(Test item in Tests) {
                     var failure = new TestResult(item);
                     listener.TestStarted(item.TestName);
                     failure.Error(ex, FailureSite.SetUp);
                     listener.TestFinished(failure);
                     result.AddResult(failure);
             }
         }, resultAdapter.AfterFailure);
     } finally {
         listener.SuiteFinished(result);
     }
     return result;
 }
开发者ID:kitofr,项目名称:Cone,代码行数:24,代码来源:AddinSuite.cs

示例9: Run

        public override TestResult Run(EventListener listener, ITestFilter filter)
        {
            listener.SuiteStarted(this.TestName);
            long startTime = DateTime.Now.Ticks;

            TestResult suiteResult = this.RunState == RunState.Runnable || this.RunState == RunState.Explicit
                ? RunSuiteInContext(listener, filter)
                : SkipSuite(listener, filter);

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

            listener.SuiteFinished(suiteResult);
            return suiteResult;
        }
开发者ID:scottwis,项目名称:eddie,代码行数:16,代码来源:TestSuite.cs

示例10: Run

		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;
		}
开发者ID:alesliehughes,项目名称:olive,代码行数:26,代码来源:TestSuite.cs


注:本文中的EventListener.SuiteStarted方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。