Freigeben über


ExpectedSqlExceptionAttribute-Klasse

 

Stellt ein Attribut dar, das angibt, dass ein Komponententest ein SqlException-Element erwartet, und gibt optional die Fehlernummer, den Schweregrad und den Zustand des erwarteten Fehlers an.

Namespace:   Microsoft.Data.Tools.Schema.Sql.UnitTesting
Assembly:  Microsoft.Data.Tools.Schema.Sql.UnitTesting (in Microsoft.Data.Tools.Schema.Sql.UnitTesting.dll)

Vererbungshierarchie

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

Konstruktoren

Name Beschreibung
System_CAPS_pubmethod ExpectedSqlExceptionAttribute()

Initialisiert eine neue Instanz der ExpectedSqlExceptionAttribute-Klasse.

System_CAPS_pubmethod ExpectedSqlExceptionAttribute(String)

Initialisiert eine neue Instanz der ExpectedSqlExceptionAttribute-Klasse.

Eigenschaften

Name Beschreibung
System_CAPS_pubproperty MatchFirstError

Ruft einen Wert ab, der angibt, ob der erwartete Schweregrad, der Zustand und die Fehlernummer mit dem ersten SqlError-Element im SqlException-Element abgeglichen werden sollen.

System_CAPS_pubproperty MessageNumber

Ruft die erwartete Fehlernummer ab oder legt sie fest.

System_CAPS_protproperty NoExceptionMessage

(Geerbt von ExpectedExceptionBaseAttribute.)

System_CAPS_pubproperty Severity

Ruft den erwarteten Wert des Schweregrads für den Fehler ab oder legt ihn fest.

System_CAPS_pubproperty State

Ruft den erwarteten Fehlerzustand des Fehlers ab oder legt ihn fest.

System_CAPS_protproperty TestContext

(Geerbt von ExpectedExceptionBaseAttribute.)

System_CAPS_pubproperty TypeId

(Geerbt von Attribute.)

Methoden

Name Beschreibung
System_CAPS_pubmethod Equals(Object)

(Geerbt von Attribute.)

System_CAPS_protmethod Finalize()

(Geerbt von Object.)

System_CAPS_pubmethod GetHashCode()

(Geerbt von Attribute.)

System_CAPS_pubmethod GetType()

(Geerbt von Object.)

System_CAPS_pubmethod IsDefaultAttribute()

(Geerbt von Attribute.)

System_CAPS_pubmethod Match(Object)

(Geerbt von Attribute.)

System_CAPS_protmethod MemberwiseClone()

(Geerbt von Object.)

System_CAPS_protmethod RethrowIfAssertException(Exception)

(Geerbt von ExpectedExceptionBaseAttribute.)

System_CAPS_pubmethod ToString()

(Geerbt von Object.)

System_CAPS_protmethod Verify(Exception)

(Setzt "ExpectedExceptionBaseAttribute.Verify(Exception)" außer Kraft.)

Explizite Schnittstellenimplementierungen

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

(Geerbt von Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

(Geerbt von Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.GetTypeInfoCount(UInt32)

(Geerbt von Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

(Geerbt von Attribute.)

Threadsicherheit

Öffentliche statische (in Visual Basic freigegebene) Member dieses Typs sind threadsicher. Bei Instanzmembern ist die Threadsicherheit nicht gewährleistet.

Siehe auch

ExpectedExceptionAttribute
Microsoft.Data.Tools.Schema.Sql.UnitTesting-Namespace

Zurück zum Anfang