Freigeben über


DefaultTestManager.ThrowTestFailureException Property

Gets or sets a value that indicates whether the test manager raises a test failure exception when it encounters a conformance error.

Namespace: Microsoft.SpecExplorer.Runtime.Testing
Assembly: Microsoft.SpecExplorer.Runtime (in Microsoft.SpecExplorer.Runtime.dll)

Usage

'Usage

Syntax

'Declaration
public bool ThrowTestFailureException { get; set; }

Property Value

true to have the test manager raise conformance exceptions; otherwise, false. The default is false.

Remarks

The TestFailedExceptionType switch controls what type of exception the test manager raises in response to a conformance error.

If the TestMethodReturnType switch is set to none or "void", the TestPassedReturnValue, TestFailedReturnValue, and TestFailedExceptionType switches are ignored and exceptions are not caught by the test case. In other words, any exceptions generated by the test case are thrown to and handled by the test harness.

If the TestMethodReturnType, TestPassedReturnValue, and TestFailedReturnValue switches are set to values other than their default values, each test case performs its steps and checks within a try-catch block. If, in addition, the TestFailedExceptionType switch is set to a value other than none, each test case performs its steps and checks within a try-catch block that catches only the specified exception type. Such exceptions specifically indicate that the test case encountered a conformance error, and the test manager raises such exceptions only if the test manager's ThrowTestFailureException property is set to true.

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Microsoft Windows 7, Microsoft Windows Vista, Microsoft Windows XP SP2 or later, Microsoft Windows Server 2008, Microsoft Windows Server 2003

See Also

Reference

DefaultTestManager Class
DefaultTestManager Members
Microsoft.SpecExplorer.Runtime.Testing Namespace