本文整理汇总了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();
}
}
示例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;
}
}
示例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));
}