Table of Contents

Class TestSessionSerializer

Namespace
Xping.Sdk.Core.Session.Serialization
Assembly
Xping.Sdk.Core.dll

A class that provides serialization and deserialization of test sessions

public sealed class TestSessionSerializer
Inheritance
TestSessionSerializer
Inherited Members

Remarks

This class supports two formats: binary and XML. Users can choose the format that suits their needs and preferences, depending on the size, readability, and compatibility of the data.

Methods

Deserialize(Stream, SerializationFormat)

Deserializes a test session from a stream using the specified format.

public TestSession? Deserialize(Stream stream, SerializationFormat format)

Parameters

stream Stream

The stream to load the serialized data

format SerializationFormat

The format to use for deserialization: Binary or XML

Returns

TestSession

The deserialized test session

Exceptions

SerializationException

When incorrect serialization format or data

Serialize(TestSession, Stream, SerializationFormat, bool)

Serializes a test session to a stream using the specified format.

public void Serialize(TestSession session, Stream stream, SerializationFormat format, bool ownsStream = false)

Parameters

session TestSession

The test session to serialize

stream Stream

The stream to save the serialized data

format SerializationFormat

The format to use for serialization: Binary or XML

ownsStream bool

True to indicate that the stream is closed by the writer when done, otherwise false