Classe ExpectedSqlExceptionAttribute
Rappresenta un attributo che specifica che uno unit test prevede un oggetto SqlException, and optionally specify the error number, severity, and state of the expected error.
Spazio dei nomi: Microsoft.Data.Tools.Schema.Sql.UnitTesting
Assembly: Microsoft.Data.Tools.Schema.Sql.UnitTesting (in Microsoft.Data.Tools.Schema.Sql.UnitTesting.dll)
Gerarchia di ereditarietà
System.Object
System.Attribute
Microsoft.VisualStudio.TestTools.UnitTesting.ExpectedExceptionBaseAttribute
Microsoft.Data.Tools.Schema.Sql.UnitTesting.ExpectedSqlExceptionAttribute
Sintassi
[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
Costruttori
Nome | Descrizione | |
---|---|---|
![]() |
ExpectedSqlExceptionAttribute() | Inizializza una nuova istanza della classe ExpectedSqlExceptionAttribute. |
![]() |
ExpectedSqlExceptionAttribute(String) | Inizializza una nuova istanza della classe ExpectedSqlExceptionAttribute. |
Proprietà
Nome | Descrizione | |
---|---|---|
![]() |
MatchFirstError | Ottiene un valore che indica se la gravità, lo stato e il numero dell'errore previsti devono corrispondere al primo oggetto SqlError in SqlException. |
![]() |
MessageNumber | Ottiene o imposta il numero dell'errore previsto. |
![]() |
NoExceptionMessage | (Ereditato da ExpectedExceptionBaseAttribute.) |
![]() |
Severity | Ottiene o imposta il valore di gravità dell'errore previsto. |
![]() |
State | Ottiene o imposta lo stato dell'errore previsto. |
![]() |
TestContext | (Ereditato da ExpectedExceptionBaseAttribute.) |
![]() |
TypeId | (Ereditato da Attribute.) |
Metodi
Nome | Descrizione | |
---|---|---|
![]() |
Equals(Object) | (Ereditato da Attribute.) |
![]() |
Finalize() | (Ereditato da Object.) |
![]() |
GetHashCode() | (Ereditato da Attribute.) |
![]() |
GetType() | (Ereditato da Object.) |
![]() |
IsDefaultAttribute() | (Ereditato da Attribute.) |
![]() |
Match(Object) | (Ereditato da Attribute.) |
![]() |
MemberwiseClone() | (Ereditato da Object.) |
![]() |
RethrowIfAssertException(Exception) | (Ereditato da ExpectedExceptionBaseAttribute.) |
![]() |
ToString() | (Ereditato da Object.) |
![]() |
Verify(Exception) | (Esegue l’override di ExpectedExceptionBaseAttribute.Verify(Exception)). |
Implementazioni esplicite dell'interfaccia
Nome | Descrizione | |
---|---|---|
![]() ![]() |
_Attribute.GetIDsOfNames(Guid, IntPtr, UInt32, UInt32, IntPtr) | (Ereditato da Attribute.) |
![]() ![]() |
_Attribute.GetTypeInfo(UInt32, UInt32, IntPtr) | (Ereditato da Attribute.) |
![]() ![]() |
_Attribute.GetTypeInfoCount(UInt32) | (Ereditato da Attribute.) |
![]() ![]() |
_Attribute.Invoke(UInt32, Guid, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr) | (Ereditato da Attribute.) |
Codice thread safe
Eventuali membri pubblici statici (Shared in Visual Basic) di questo tipo sono thread-safe. I membri di istanza non sono garantiti come thread-safe.
Vedere anche
ExpectedExceptionAttribute
Spazio dei nomi Microsoft.Data.Tools.Schema.Sql.UnitTesting
Torna all'inizio