C# Class Spring.Util.SerializationTestUtils

Utilities for testing serializability of objects.
Exposes static methods for use in other test cases.
Show file Open project: spring-projects/spring-net

Public Methods

Method Description
IsSerializable ( object o ) : bool

Tests whether the specified object is serializable.

SerializeAndDeserialize ( object o ) : object

Serializes the specified object to an in-memory stream, and returns the result of deserializing the object stream.

TrySerialization ( object o ) : void

Attempts to serialize the specified object to an in-memory stream.

Private Methods

Method Description
WithNonSerializableObject ( ) : void
WithSerializableObject ( ) : void

Method Details

IsSerializable() public static method

Tests whether the specified object is serializable.
public static IsSerializable ( object o ) : bool
o object the object to test.
return bool

SerializeAndDeserialize() public static method

Serializes the specified object to an in-memory stream, and returns the result of deserializing the object stream.
public static SerializeAndDeserialize ( object o ) : object
o object the object to use.
return object

TrySerialization() public static method

Attempts to serialize the specified object to an in-memory stream.
public static TrySerialization ( object o ) : void
o object the object to serialize
return void