Partilhar via


TestFailureException Class

The exception that is thrown when a test case assertion fails.

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

Usage

'Usage

Syntax

'Declaration
[SerializableAttribute] 
public class TestFailureException : Exception

Remarks

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.

Inheritance Hierarchy

System.Object
   System.Exception
    Microsoft.SpecExplorer.Runtime.Testing.TestFailureException

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

TestFailureException Members
Microsoft.SpecExplorer.Runtime.Testing Namespace
DefaultTestManager.ThrowTestFailureException Property

Other Resources

Test Code Generation Switches