Interface IFailureScenarioService
- Namespace
- ReferenceApplication.Web.Governance.FailureScenarios
- Assembly
- ReferenceApplication.Web.dll
Lists, arms, and reports on the Development-only failure scenarios.
public interface IFailureScenarioService
Methods
ClearDeliveryFault(string)
Clears a run's delivery fault, so the outbox's next attempt can deliver the entry.
bool ClearDeliveryFault(string runId)
Parameters
runIdstringThe run identifier.
Returns
GetRunAsync(string, CancellationToken)
Reports what a run's request did and what evidence it left behind.
Task<FailureScenarioRunReport?> GetRunAsync(string runId, CancellationToken cancellationToken = default)
Parameters
runIdstringThe run identifier.
cancellationTokenCancellationTokenA token that cancels the call.
Returns
- Task<FailureScenarioRunReport>
The report, or null when the run is unknown.
GetScenarios(ClaimsPrincipal)
Lists the scenarios, with whether an actor can run each one now.
IReadOnlyList<FailureScenarioView> GetScenarios(ClaimsPrincipal actor)
Parameters
actorClaimsPrincipalThe actor viewing the scenarios.
Returns
- IReadOnlyList<FailureScenarioView>
The scenarios, in order.
StartAsync(string, string?, HttpContext, CancellationToken)
Arms a scenario for the current actor's next request, or, for the evidence-tampering scenario, runs it.
Task<FailureScenarioStartResult> StartAsync(string scenarioId, string? correlationId, HttpContext httpContext, CancellationToken cancellationToken = default)
Parameters
scenarioIdstringThe scenario to run.
correlationIdstringFor the evidence-tampering scenario, the decision to copy; the latest when omitted.
httpContextHttpContextThe request asking to run the scenario.
cancellationTokenCancellationTokenA token that cancels the call.
Returns
- Task<FailureScenarioStartResult>
The armed run, the tampering result, or why the scenario cannot run.