Verifies that a type supports the runtime serialization protocol.

Namespace:  MbUnit.Framework
Assembly:  MbUnit (in MbUnit.dll) Version: 3.3.0.0 (3.3.610.0)

Syntax

C#
public static void IsSerializableType(
	Type type,
	string messageFormat,
	params Object[] messageArgs
)
Visual Basic (Declaration)
Public Shared Sub IsSerializableType ( _
	type As Type, _
	messageFormat As String, _
	ParamArray messageArgs As Object() _
)

Parameters

type
Type: System..::.Type
The type to verify.
messageFormat
Type: System..::.String
The custom assertion message format, or null if none.
messageArgs
Type: array< System..::.Object >[]()[]
The custom assertion message arguments, or null if none.

Remarks

Ensures that the type has the SerializableAttribute. Also ensures that if it implements ISerializable then it also has a deserialization constructor with signature .ctor(SerializationInfo, StreamingContext).

Exceptions

ExceptionCondition
Gallio.Framework.Assertions..::.AssertionExceptionThrown if the verification failed unless the current AssertionFailureBehavior indicates otherwise.
System..::.ArgumentNullExceptionThrown if type is null.

See Also