Verifies that an object can be serialized and deserialized to and from a stream using the specified IFormatter and returns the resulting deserialized object.

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

Syntax

C#
public static T SerializeThenDeserialize<T>(
	T value,
	IFormatter formatter,
	string messageFormat,
	params Object[] messageArgs
)
Visual Basic (Declaration)
Public Shared Function SerializeThenDeserialize(Of T) ( _
	value As T, _
	formatter As IFormatter, _
	messageFormat As String, _
	ParamArray messageArgs As Object() _
) As T

Parameters

value
Type: T
The value.
formatter
Type: System.Runtime.Serialization..::.IFormatter
The object serialization formatter.
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.

Type Parameters

T

Return Value

The serialized then deserialized object.

Remarks

The assertion fails if value is null.

Exceptions

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

See Also