ExpectedSqlExceptionAttribute, classe

 

Représente un attribut qui spécifie qu'un test unitaire attend un SqlException, et spécifie éventuellement le numéro d'erreur, la gravité et l'état de l'erreur attendue.

Espace de noms:   Microsoft.Data.Tools.Schema.Sql.UnitTesting
Assembly:  Microsoft.Data.Tools.Schema.Sql.UnitTesting (dans Microsoft.Data.Tools.Schema.Sql.UnitTesting.dll)

Hiérarchie d'héritage

System.Object
  System.Attribute
    Microsoft.VisualStudio.TestTools.UnitTesting.ExpectedExceptionBaseAttribute
      Microsoft.Data.Tools.Schema.Sql.UnitTesting.ExpectedSqlExceptionAttribute

Syntaxe

[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

Constructeurs

Nom Description
System_CAPS_pubmethod ExpectedSqlExceptionAttribute()

Initialise une nouvelle instance de la classe ExpectedSqlExceptionAttribute.

System_CAPS_pubmethod ExpectedSqlExceptionAttribute(String)

Initialise une nouvelle instance de la classe ExpectedSqlExceptionAttribute.

Propriétés

Nom Description
System_CAPS_pubproperty MatchFirstError

Obtient une valeur qui indique si la gravité, l’état et le numéro d’erreur attendus doivent être mis en correspondance avec le premier SqlError dans le SqlException.

System_CAPS_pubproperty MessageNumber

Obtient ou définit le numéro d'erreur attendu.

System_CAPS_protproperty NoExceptionMessage

(Hérité de ExpectedExceptionBaseAttribute.)

System_CAPS_pubproperty Severity

Obtient ou définit la valeur de gravité attendue de l'erreur.

System_CAPS_pubproperty State

Obtient ou définit l'état d'erreur attendu de l'erreur.

System_CAPS_protproperty TestContext

(Hérité de ExpectedExceptionBaseAttribute.)

System_CAPS_pubproperty TypeId

(Hérité de Attribute.)

Méthodes

Nom Description
System_CAPS_pubmethod Equals(Object)

(Hérité de Attribute.)

System_CAPS_protmethod Finalize()

(Hérité de Object.)

System_CAPS_pubmethod GetHashCode()

(Hérité de Attribute.)

System_CAPS_pubmethod GetType()

(Hérité de Object.)

System_CAPS_pubmethod IsDefaultAttribute()

(Hérité de Attribute.)

System_CAPS_pubmethod Match(Object)

(Hérité de Attribute.)

System_CAPS_protmethod MemberwiseClone()

(Hérité de Object.)

System_CAPS_protmethod RethrowIfAssertException(Exception)

(Hérité de ExpectedExceptionBaseAttribute.)

System_CAPS_pubmethod ToString()

(Hérité de Object.)

System_CAPS_protmethod Verify(Exception)

(Remplace ExpectedExceptionBaseAttribute.Verify(Exception).)

Implémentations d'interface explicite

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

(Hérité de Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

(Hérité de Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.GetTypeInfoCount(UInt32)

(Hérité de Attribute.)

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

(Hérité de Attribute.)

Sécurité des threads

Tous les membres statiques (Shared en Visual Basic) publics de ce type sont thread-safe. Il n'est pas garanti que les membres d'instance soient thread-safe.

Voir aussi

ExpectedExceptionAttribute
Microsoft.Data.Tools.Schema.Sql.UnitTesting, espace de noms

Retour au début