ExpectedSqlExceptionAttribute Class
Represents an attribute that specifies that a unit test is expecting a SqlException, and optionally specify the error number, severity, and state of the expected error.
Namespace: Microsoft.Data.Tools.Schema.Sql.UnitTesting
Assembly: Microsoft.Data.Tools.Schema.Sql.UnitTesting (in Microsoft.Data.Tools.Schema.Sql.UnitTesting.dll)
Inheritance Hierarchy
System.Object
System.Attribute
Microsoft.VisualStudio.TestTools.UnitTesting.ExpectedExceptionBaseAttribute
Microsoft.Data.Tools.Schema.Sql.UnitTesting.ExpectedSqlExceptionAttribute
Syntax
[AttributeUsageAttribute(AttributeTargets.Method, AllowMultiple = false,
Inherited = true)]
public class ExpectedSqlExceptionAttribute : ExpectedExceptionBaseAttribute
[AttributeUsageAttribute(AttributeTargets::Method, AllowMultiple = false,
Inherited = true)]
public ref class ExpectedSqlExceptionAttribute : ExpectedExceptionBaseAttribute
[<AttributeUsageAttribute(AttributeTargets.Method, AllowMultiple = false,
Inherited = true)>]
type ExpectedSqlExceptionAttribute =
class
inherit ExpectedExceptionBaseAttribute
end
<AttributeUsageAttribute(AttributeTargets.Method, AllowMultiple := False,
Inherited := True)>
Public Class ExpectedSqlExceptionAttribute
Inherits ExpectedExceptionBaseAttribute
Constructors
Name | Description | |
---|---|---|
![]() |
ExpectedSqlExceptionAttribute() | Initializes a new instance of the ExpectedSqlExceptionAttribute class. |
![]() |
ExpectedSqlExceptionAttribute(String) | Initializes a new instance of the ExpectedSqlExceptionAttribute class. |
Properties
Name | Description | |
---|---|---|
![]() |
MatchFirstError | Gets a value that indicates whether the expected severity, state, and error number are to be matched against the first SqlError in the SqlException. |
![]() |
MessageNumber | Gets or sets the expected error number. |
![]() |
NoExceptionMessage | (Inherited from ExpectedExceptionBaseAttribute.) |
![]() |
Severity | Gets or sets the expected severity value of the error. |
![]() |
State | Gets or sets the expected error state of the error. |
![]() |
TestContext | (Inherited from ExpectedExceptionBaseAttribute.) |
![]() |
TypeId | (Inherited from Attribute.) |
Methods
Name | Description | |
---|---|---|
![]() |
Equals(Object) | (Inherited from Attribute.) |
![]() |
Finalize() | (Inherited from Object.) |
![]() |
GetHashCode() | (Inherited from Attribute.) |
![]() |
GetType() | (Inherited from Object.) |
![]() |
IsDefaultAttribute() | (Inherited from Attribute.) |
![]() |
Match(Object) | (Inherited from Attribute.) |
![]() |
MemberwiseClone() | (Inherited from Object.) |
![]() |
RethrowIfAssertException(Exception) | (Inherited from ExpectedExceptionBaseAttribute.) |
![]() |
ToString() | (Inherited from Object.) |
![]() |
Verify(Exception) | (Overrides ExpectedExceptionBaseAttribute.Verify(Exception).) |
Explicit Interface Implementations
Name | Description | |
---|---|---|
![]() ![]() |
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) | (Inherited from Attribute.) |
![]() ![]() |
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) | (Inherited from Attribute.) |
![]() ![]() |
_Attribute.GetTypeInfoCount(UInt32) | (Inherited from Attribute.) |
![]() ![]() |
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) | (Inherited from Attribute.) |
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.
See Also
ExpectedExceptionAttribute
Microsoft.Data.Tools.Schema.Sql.UnitTesting Namespace
Return to top