Verifies that an object can be deserialized from a stream using the
specified IFormatter and returns the resulting deserialized object.
Namespace:
MbUnit.FrameworkAssembly: MbUnit (in MbUnit.dll) Version: 3.3.0.0 (3.3.610.0)
Syntax
| C# |
|---|
public static T Deserialize<T>( Stream stream, IFormatter formatter ) |
| Visual Basic (Declaration) |
|---|
Public Shared Function Deserialize(Of T) ( _ stream As Stream, _ formatter As IFormatter _ ) As T |
Parameters
- stream
- Type: System.IO..::.Stream
The stream to deserialize.
- formatter
- Type: System.Runtime.Serialization..::.IFormatter
The object serialization formatter.
Type Parameters
- T
Return Value
The deserialized object.
Remarks
The assertion fails if stream is null.
Exceptions
| Exception | Condition |
|---|---|
| System..::.ArgumentNullException | Thrown if formatter is null. |
| Gallio.Framework.Assertions..::.AssertionException | Thrown if the verification failed unless the current AssertionFailureBehavior indicates otherwise. |
