Partilhar via


Classe ExpectedSqlExceptionAttribute

 

Representa um atributo que especifica que um teste de unidade está esperando um SqlException e, opcionalmente, especifica o número do erro, a severidade e o estado do erro esperado.

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

Hierarquia de herança

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

Sintaxe

[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

Construtores

Nome Descrição
System_CAPS_pubmethod ExpectedSqlExceptionAttribute()

Inicializa uma nova instância da classe ExpectedSqlExceptionAttribute.

System_CAPS_pubmethod ExpectedSqlExceptionAttribute(String)

Inicializa uma nova instância da classe ExpectedSqlExceptionAttribute.

Propriedades

Nome Descrição
System_CAPS_pubproperty MatchFirstError

Obtém um valor que indica se a severidade, o estado e o número de erro esperados coincidem com o primeiro SqlError no SqlException.

System_CAPS_pubproperty MessageNumber

Obtém ou define o número de erro esperado.

System_CAPS_protproperty NoExceptionMessage

(herdado de ExpectedExceptionBaseAttribute.)

System_CAPS_pubproperty Severity

Obtém ou define o valor de severidade esperado do erro.

System_CAPS_pubproperty State

Obtém ou define o estado de erro esperado do erro.

System_CAPS_protproperty TestContext

(herdado de ExpectedExceptionBaseAttribute.)

System_CAPS_pubproperty TypeId

(herdado de Attribute.)

Métodos

Nome Descrição
System_CAPS_pubmethod Equals(Object)

(herdado de Attribute.)

System_CAPS_protmethod Finalize()

(herdado de Object.)

System_CAPS_pubmethod GetHashCode()

(herdado de Attribute.)

System_CAPS_pubmethod GetType()

(herdado de Object.)

System_CAPS_pubmethod IsDefaultAttribute()

(herdado de Attribute.)

System_CAPS_pubmethod Match(Object)

(herdado de Attribute.)

System_CAPS_protmethod MemberwiseClone()

(herdado de Object.)

System_CAPS_protmethod RethrowIfAssertException(Exception)

(herdado de ExpectedExceptionBaseAttribute.)

System_CAPS_pubmethod ToString()

(herdado de Object.)

System_CAPS_protmethod Verify(Exception)

(Substitui ExpectedExceptionBaseAttribute.Verify(Exception).)

Implementações explícitas da interface

Nome Descrição
System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr)

(herdado de Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.GetTypeInfo(UInt32, UInt32, IntPtr)

(herdado de Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod _Attribute.GetTypeInfoCount(UInt32)

(herdado de Attribute.)

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

(herdado de Attribute.)

Acesso thread-safe

Qualquer estático público (Compartilhado no Visual Basic) membros desde tipo são thread safe. Não há garantia de que qualquer membro de instância seja thread-safe.

Consulte também

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

Retornar ao topo