Table of Contents

Class TestHostBag

Namespace
Mokkit.Suite
Assembly
Mokkit.dll

Represents a thread-safe collection for storing and retrieving test-related objects by their type. This class provides a type-based storage mechanism that allows test components to share data and services across test execution phases.

public class TestHostBag

Inheritance

Inherited Members

Methods

TryAdd(Type, object)

Attempts to add an object to the bag with the specified service type as the key. If an object with the same type already exists, this method will not replace it.

public void TryAdd(Type serviceType, object implementation)

Parameters

serviceType Type

The type to use as the key for storing the object.

implementation object

The object instance to store in the bag.

TryGet(Type)

Attempts to retrieve an object from the bag using the specified service type as the key.

public object? TryGet(Type serviceType)

Parameters

serviceType Type

The type to use as the key for retrieving the object.

Returns

object?

The object associated with the specified type, or null if no object is found.