共用方式為


AssertFailedException Constructor (SerializationInfo, StreamingContext)

Initializes a new instance of the AssertFailedException class with serialized data.

Namespace:  Microsoft.VisualStudio.TestTools.UnitTesting
Assembly:  Microsoft.VisualStudio.QualityTools.UnitTestFramework (in Microsoft.VisualStudio.QualityTools.UnitTestFramework.dll)

Syntax

'Declaration
Protected Sub New ( _
    info As SerializationInfo, _
    context As StreamingContext _
)
protected AssertFailedException(
    SerializationInfo info,
    StreamingContext context
)
protected:
AssertFailedException(
    SerializationInfo^ info, 
    StreamingContext context
)
new : 
        info:SerializationInfo * 
        context:StreamingContext -> AssertFailedException
protected function AssertFailedException(
    info : SerializationInfo, 
    context : StreamingContext
)

Parameters

  • info
    Type: SerializationInfo

    The SerializationInfo that holds the serialized object data about the exception being thrown.

  • context
    Type: StreamingContext

    The StreamingContext that contains contextual information about the source or destination.

Exceptions

Exception Condition
ArgumentNullException

info is nulla null reference (Nothing in Visual Basic).

SerializationException

The class name is nulla null reference (Nothing in Visual Basic) or HResult is zero (0).

.NET Framework Security

See Also

Reference

AssertFailedException Class

AssertFailedException Overload

Microsoft.VisualStudio.TestTools.UnitTesting Namespace

Other Resources

Using the Assert Classes