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
System_CAPS_pubmethod ExpectedSqlExceptionAttribute()

Initializes a new instance of the ExpectedSqlExceptionAttribute class.

System_CAPS_pubmethod ExpectedSqlExceptionAttribute(String)

Initializes a new instance of the ExpectedSqlExceptionAttribute class.

Properties

Name Description
System_CAPS_pubproperty 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.

System_CAPS_pubproperty MessageNumber

Gets or sets the expected error number.

System_CAPS_protproperty NoExceptionMessage

(Inherited from ExpectedExceptionBaseAttribute.)

System_CAPS_pubproperty Severity

Gets or sets the expected severity value of the error.

System_CAPS_pubproperty State

Gets or sets the expected error state of the error.

System_CAPS_protproperty TestContext

(Inherited from ExpectedExceptionBaseAttribute.)

System_CAPS_pubproperty TypeId

(Inherited from Attribute.)

Methods

Name Description
System_CAPS_pubmethod Equals(Object)

(Inherited from Attribute.)

System_CAPS_protmethod Finalize()

(Inherited from Object.)

System_CAPS_pubmethod GetHashCode()

(Inherited from Attribute.)

System_CAPS_pubmethod GetType()

(Inherited from Object.)

System_CAPS_pubmethod IsDefaultAttribute()

(Inherited from Attribute.)

System_CAPS_pubmethod Match(Object)

(Inherited from Attribute.)

System_CAPS_protmethod MemberwiseClone()

(Inherited from Object.)

System_CAPS_protmethod RethrowIfAssertException(Exception)

(Inherited from ExpectedExceptionBaseAttribute.)

System_CAPS_pubmethod ToString()

(Inherited from Object.)

System_CAPS_protmethod Verify(Exception)

(Overrides ExpectedExceptionBaseAttribute.Verify(Exception).)

Explicit Interface Implementations

Name Description
System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

(Inherited from Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

(Inherited from Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.GetTypeInfoCount(UInt32)

(Inherited from Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod _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