Class TestScenarioContext
- Namespace
- XBullet.EasyTesting.Hosting
- Assembly
- XBullet.EasyTesting.dll
Provides the scenario identifier and cleanup registration to host extensions.
public sealed class TestScenarioContext
- Inheritance
-
TestScenarioContext
- Inherited Members
Properties
ScenarioId
Gets the unique identifier for this scenario scope.
public string ScenarioId { get; }
Property Value
- string
A non-empty identifier generated for this scope. The identifier remains stable until the scope is disposed.
Methods
DisposeWithScenario(IAsyncDisposable)
Registers an asynchronously disposable scenario-owned resource.
public void DisposeWithScenario(IAsyncDisposable resource)
Parameters
resourceIAsyncDisposableThe resource whose ownership transfers to the scenario. It is disposed once during cleanup, in reverse registration order.
DisposeWithScenario(IDisposable)
Registers a disposable scenario-owned resource.
public void DisposeWithScenario(IDisposable resource)
Parameters
resourceIDisposableThe resource whose ownership transfers to the scenario. It is disposed once during cleanup, in reverse registration order.
OnCleanup(Func<ValueTask>)
Registers a custom scenario cleanup action.
public void OnCleanup(Func<ValueTask> cleanup)