Class UnhandledExceptionHandlingAttribute
Specifies the handling behavior for unhandled exceptions in the assembly, class, or method.
Implements
Inherited Members
Namespace: NUnit.Framework
Assembly: nunit.framework.dll
Syntax
[AttributeUsage(AttributeTargets.Assembly|AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = true, Inherited = true)]
public sealed class UnhandledExceptionHandlingAttribute : PropertyAttribute, IApplyToTest
Remarks
This attribute can be applied to assemblies, classes, or methods to define how unhandled exceptions should be managed. It allows for centralized exception handling strategies across different components of an application.
Constructors
View SourceUnhandledExceptionHandlingAttribute(UnhandledExceptionHandling)
Initializes a new instance of the UnhandledExceptionHandlingAttribute class with the specified handling behavior.
Declaration
public UnhandledExceptionHandlingAttribute(UnhandledExceptionHandling handling)
Parameters
| Type | Name | Description |
|---|---|---|
| UnhandledExceptionHandling | handling | The flag indicating how exceptions not handled by the user should be handled. |
UnhandledExceptionHandlingAttribute(UnhandledExceptionHandling, params Type[])
Initializes a new instance of the UnhandledExceptionHandlingAttribute class with the specified handling behavior.
Declaration
public UnhandledExceptionHandlingAttribute(UnhandledExceptionHandling handling, params Type[] exceptions)
Parameters
| Type | Name | Description |
|---|---|---|
| UnhandledExceptionHandling | handling | The flag indicating how exceptions not handled by the user should be handled. |
| Type[] | exceptions | The exceptions types to be handled liek this. |