Class AzureFunctionTestScenarioScope

Namespace
XBullet.EasyTesting.AzureFunctions
Assembly
XBullet.EasyTesting.AzureFunctions.dll

Owns one serialized Functions test scenario, resource resets, and registered cleanup.

public sealed class AzureFunctionTestScenarioScope : IAsyncDisposable
Inheritance
AzureFunctionTestScenarioScope
Implements
Inherited Members
Extension Methods

Remarks

The host is borrowed; invocations keep their own DI scopes. Dispose the scenario before its host.

Properties

Context

Gets cleanup registration for scenario-owned objects and actions.

public TestScenarioContext Context { get; }

Property Value

TestScenarioContext

The context owned by this scope; use it only while the scenario is active.

Diagnostics

Gets failure diagnostics captured by the scenario runner.

public TestScenarioDiagnostics? Diagnostics { get; }

Property Value

TestScenarioDiagnostics

The captured diagnostics, or null when the runner has not observed a failure.

Host

Gets the borrowed function host while this scenario is active.

public AzureFunctionTestHost Host { get; }

Property Value

AzureFunctionTestHost

The caller-owned host used for contexts, trigger builders, and invocations.

ScenarioId

Gets this scenario's stable identifier.

public string ScenarioId { get; }

Property Value

string

The unique identifier generated at scope creation.

Methods

DisposeAsync()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources asynchronously.

public ValueTask DisposeAsync()

Returns

ValueTask

A task that represents the asynchronous dispose operation.

GetResource<TResource>(string)

Gets a borrowed, named resource registered on the function host.

public TResource GetResource<TResource>(string name) where TResource : class, ITestScenarioResource

Parameters

name string

The non-empty, case-insensitively matched resource name.

Returns

TResource

The caller-owned resource; this scenario resets but never disposes it.

Type Parameters

TResource

The expected resource type.