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


C# TestResult.NotRun方法代码示例

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


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

示例1: DoFixtureSetUp

        public override void DoFixtureSetUp(TestResult suiteResult)
        {
            try
            {
                _fixture.FixtureSetup();

                Status = SetUpState.SetUpComplete;
            }
            catch (Exception ex)
            {
                if (ex is NunitException || ex is TargetInvocationException)
                    ex = ex.InnerException;

                if (testFramework.IsIgnoreException(ex))
                {
                    ShouldRun = false;
                    suiteResult.NotRun(ex.Message);
                    suiteResult.StackTrace = ex.StackTrace;
                    IgnoreReason = ex.Message;
                }
                else
                {
                    suiteResult.Failure(ex.Message, ex.StackTrace);
                    Status = SetUpState.SetUpFailed;
                }
            }
            finally
            {
                if (testFramework != null)
                    suiteResult.AssertCount = testFramework.GetAssertCount();
            }
        }
开发者ID:tiwariritesh7,项目名称:devdefined-tools,代码行数:32,代码来源:PythonFixtureExtension.cs

示例2: DoSetUp

		public override void DoSetUp( TestResult suiteResult )
		{
			try 
			{
				if ( Fixture == null )
					Fixture = Reflect.Construct( fixtureType );

				if (this.fixtureSetUp != null)
					Reflect.InvokeMethod(fixtureSetUp, Fixture);
				IsSetUp = true;
			} 
			catch (Exception ex) 
			{
				// Error in TestFixtureSetUp causes the suite and
				// all contained suites to be ignored.
				// TODO: Change this to be a failure?
				NunitException nex = ex as NunitException;
				if (nex != null)
					ex = nex.InnerException;

				if ( ex is NUnit.Framework.IgnoreException )
				{
					this.ShouldRun = false;
					suiteResult.NotRun(ex.Message);
					suiteResult.StackTrace = ex.StackTrace;
					this.IgnoreReason = ex.Message;
				}
				else
				{
					suiteResult.Failure( ex.Message, ex.StackTrace, true );
				}
			}
			finally
			{
				suiteResult.AssertCount = NUnit.Framework.Assert.Counter;
			}
		}
开发者ID:alesliehughes,项目名称:olive,代码行数:37,代码来源:TestFixture.cs

示例3: RecordException

 protected void RecordException(Exception ex, TestResult testResult)
 {
     if (testFramework.IsIgnoreException(ex))
         testResult.NotRun(ex.Message);
     else if (testFramework.IsAssertException(ex))
         testResult.Failure(ex.Message, ex.StackTrace);
     else
         testResult.Failure(BuildMessage(ex), BuildStackTrace(ex));
 }
开发者ID:tiwariritesh7,项目名称:devdefined-tools,代码行数:9,代码来源:PythonTestMethod.cs


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