Interface ITestScenarioResource
- Namespace
- XBullet.EasyTesting.Hosting
- Assembly
- XBullet.EasyTesting.dll
Mutable test state that participates in scenario reset and failure diagnostics.
public interface ITestScenarioResource
Methods
CaptureDiagnosticsAsync(CancellationToken)
Captures the current state before a failed scenario is cleaned up.
ValueTask<object?> CaptureDiagnosticsAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancels diagnostic collection for this resource. The default token does not request cancellation. A thrown exception, including cancellation, is recorded as a diagnostic capture failure so cleanup can continue.
Returns
- ValueTask<object>
A serializable diagnostic value, or null when the resource has no state to report. Ownership remains with the resource unless its implementation states otherwise.
ResetAsync(CancellationToken)
Clears mutable state before and after a scenario.
ValueTask ResetAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenCancels this reset attempt. The default token does not request cancellation. The factory continues resetting the remaining registered resources and reports all reset failures together.
Returns
- ValueTask
A task that completes when the resource has finished resetting its state.