Table of Contents

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

runId string

The run identifier.

Returns

bool

true when the run held an active delivery fault.

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

runId string

The run identifier.

cancellationToken CancellationToken

A 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

actor ClaimsPrincipal

The 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

scenarioId string

The scenario to run.

correlationId string

For the evidence-tampering scenario, the decision to copy; the latest when omitted.

httpContext HttpContext

The request asking to run the scenario.

cancellationToken CancellationToken

A token that cancels the call.

Returns

Task<FailureScenarioStartResult>

The armed run, the tampering result, or why the scenario cannot run.