Class FunctionScenario
- Namespace
- XBullet.EasyTesting.AzureFunctions
- Assembly
- XBullet.EasyTesting.AzureFunctions.dll
Provides guarded, single-use domain arrangement for a Functions scenario.
public abstract class FunctionScenario
- Inheritance
-
FunctionScenario
- Inherited Members
- Extension Methods
Remarks
The caller owns the borrowed scope. Instances must not be configured or arranged concurrently.
Constructors
FunctionScenario(AzureFunctionTestScenarioScope)
Creates a domain scenario associated with an active Functions scope.
protected FunctionScenario(AzureFunctionTestScenarioScope scope)
Parameters
scopeAzureFunctionTestScenarioScopeThe non-null caller-owned scope, which this helper never disposes.
Properties
Scope
Gets the borrowed Functions scenario scope.
protected AzureFunctionTestScenarioScope Scope { get; }
Property Value
- AzureFunctionTestScenarioScope
The caller-owned scope kept alive throughout setup and invocations.
Methods
ArrangeAsync(CancellationToken)
Freezes configuration and performs arrangement once.
public Task ArrangeAsync(CancellationToken cancellationToken = default)
Parameters
cancellationTokenCancellationTokenThe token checked before setup and passed to the domain callback.
Returns
- Task
A task completing when arrangement finishes.
Remarks
Failure or cancellation consumes the helper. Create a new instance to retry.
ArrangeCoreAsync(CancellationToken)
Applies the domain's configured stubs, resource state, or persisted data.
protected abstract Task ArrangeCoreAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenThe arrangement cancellation token.
Returns
- Task
A non-null task completing when domain setup finishes.
EnsureNotArranged()
Rejects configuration changes after arrangement starts.
protected void EnsureNotArranged()
Remarks
Call from domain configuration methods before changing their state.