共用方式為


UnitTestAssertException.GetObjectData 方法

使用例外狀況的相關資訊設定 SerializationInfo

命名空間:  Microsoft.VisualStudio.TestTools.UnitTesting
組件:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (在 Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll 中)

語法

'宣告
<SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter := True)> _
Public Overrides Sub GetObjectData ( _
    info As SerializationInfo, _
    context As StreamingContext _
)
[SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)]
public override void GetObjectData(
    SerializationInfo info,
    StreamingContext context
)
[SecurityPermissionAttribute(SecurityAction::Demand, SerializationFormatter = true)]
public:
virtual void GetObjectData(
    SerializationInfo^ info, 
    StreamingContext context
) override
[<SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)>]
abstract GetObjectData : 
        info:SerializationInfo * 
        context:StreamingContext -> unit 
[<SecurityPermissionAttribute(SecurityAction.Demand, SerializationFormatter = true)>]
override GetObjectData : 
        info:SerializationInfo * 
        context:StreamingContext -> unit 
public override function GetObjectData(
    info : SerializationInfo, 
    context : StreamingContext
)

參數

實作

ISerializable.GetObjectData(SerializationInfo, StreamingContext)
_Exception.GetObjectData(SerializationInfo, StreamingContext)

例外狀況

例外狀況 條件
ArgumentNullException

info 參數為 nullnull 參考 (即 Visual Basic 中的 Nothing)。

.NET Framework 安全性

請參閱

參考

UnitTestAssertException 類別

Microsoft.VisualStudio.TestTools.UnitTesting 命名空間