Table of Contents

Class TestSessionExtensions

Namespace
Xping.Sdk.Core.Extensions
Assembly
Xping.Sdk.Core.dll

Provides extension methods for the TestSession class to access property bag values.

public static class TestSessionExtensions
Inheritance
TestSessionExtensions
Inherited Members

Methods

GetNonSerializablePropertyBagValue<TValue>(TestSession, PropertyBagKey)

Gets a non-serializable value from the property bag of the test session.

public static TValue? GetNonSerializablePropertyBagValue<TValue>(this TestSession session, PropertyBagKey key)

Parameters

session TestSession

The test session to get the value from.

key PropertyBagKey

The key of the value to get.

Returns

TValue

The value associated with the key, or null if not found.

Type Parameters

TValue

The type of the value to get.

GetPropertyBagValue<TValue>(TestSession, PropertyBagKey)

Gets a serializable value from the property bag of the test session.

public static TValue? GetPropertyBagValue<TValue>(this TestSession session, PropertyBagKey key)

Parameters

session TestSession

The test session to get the value from.

key PropertyBagKey

The key of the value to get.

Returns

TValue

The value associated with the key, or null if not found.

Type Parameters

TValue

The type of the value to get.

TryGetPropertyBagValue<TValue>(TestSession, PropertyBagKey, out NonSerializable<TValue>?)

Tries to get a non-serializable value from the property bag of the test session.

public static bool TryGetPropertyBagValue<TValue>(this TestSession session, PropertyBagKey key, out NonSerializable<TValue>? value)

Parameters

session TestSession

The test session to get the value from.

key PropertyBagKey

The key of the value to get.

value NonSerializable<TValue>

The output parameter that will receive the value if found.

Returns

bool

True if the value was found, false otherwise.

Type Parameters

TValue

The type of the value to get.

TryGetPropertyBagValue<TValue>(TestSession, PropertyBagKey, out PropertyBagValue<TValue>?)

Tries to get a serializable value from the property bag of the test session.

public static bool TryGetPropertyBagValue<TValue>(this TestSession session, PropertyBagKey key, out PropertyBagValue<TValue>? value)

Parameters

session TestSession

The test session to get the value from.

key PropertyBagKey

The key of the value to get.

value PropertyBagValue<TValue>

The output parameter that will receive the value if found.

Returns

bool

True if the value was found, false otherwise.

Type Parameters

TValue

The type of the value to get.