Class ProtoFlow

Namespace
ProtoTest.Core
Assembly
ProtoTest.Core.dll

A named, traced sequence of steps: each step is one operation whose outcome is derived, and the flow either stops at the first failure or collects every failure. This is the shared sequence primitive for lifecycle phases and teardown chains, so a release chain reads as a list of steps instead of a loop, an exception list and a tracing helper.

public sealed class ProtoFlow
Inheritance
ProtoFlow
Inherited Members
Extension Methods

Constructors

ProtoFlow(string, string, ProtoFlowFailureMode)

public ProtoFlow(string name, string source, ProtoFlowFailureMode failureMode = ProtoFlowFailureMode.FailFast)

Parameters

name string
source string
failureMode ProtoFlowFailureMode

Methods

RunAsync(IProtoTraceWriter, CancellationToken)

Runs the steps in order. Cancelling the flow's token always stops the flow and propagates; in collect mode a step that cancels for any other reason is recorded like any failure and the remaining steps still run, so teardown never skips cleanup. Step failures are returned in Failures, so the caller decides whether to throw.

public ValueTask<ProtoFlowResult> RunAsync(IProtoTraceWriter trace, CancellationToken cancellationToken = default)

Parameters

trace IProtoTraceWriter
cancellationToken CancellationToken

Returns

ValueTask<ProtoFlowResult>

Step(ProtoStepDescriptor, Func<CancellationToken, ValueTask>)

Appends a step traced as the operation the descriptor declares.

public ProtoFlow Step(ProtoStepDescriptor step, Func<CancellationToken, ValueTask> action)

Parameters

step ProtoStepDescriptor
action Func<CancellationToken, ValueTask>

Returns

ProtoFlow

Step(string, Func<CancellationToken, ValueTask>)

Appends a step traced as the generic flow.step operation.

public ProtoFlow Step(string name, Func<CancellationToken, ValueTask> action)

Parameters

name string
action Func<CancellationToken, ValueTask>

Returns

ProtoFlow