Class AzureTestingExtensions

Namespace
XBullet.EasyTesting.Azure
Assembly
XBullet.EasyTesting.Azure.dll

Registers deterministic Azure credentials and client replacements in test hosts.

public static class AzureTestingExtensions
Inheritance
AzureTestingExtensions
Inherited Members

Methods

ReplaceAzureClient<TClient>(TestScenarioScopeBuilder, TClient)

Replaces a directly injected Azure SDK client for one test scenario.

public static TestScenarioScopeBuilder ReplaceAzureClient<TClient>(this TestScenarioScopeBuilder builder, TClient client) where TClient : class

Parameters

builder TestScenarioScopeBuilder

The non-null scenario-scope builder to configure.

client TClient

The non-null client instance registered as a scenario singleton. The instance is retained; because it was supplied externally, the caller remains responsible for disposing it when needed.

Returns

TestScenarioScopeBuilder

The same scenario-scope builder, for chaining.

Type Parameters

TClient

The reference type registered and resolved directly from dependency injection.

ReplaceAzureClient<TEntryPoint, TClient>(EasyTestHostBuilder<TEntryPoint>, TClient)

Replaces a directly injected Azure SDK client for every test scenario.

public static EasyTestHostBuilder<TEntryPoint> ReplaceAzureClient<TEntryPoint, TClient>(this EasyTestHostBuilder<TEntryPoint> builder, TClient client) where TEntryPoint : class where TClient : class

Parameters

builder EasyTestHostBuilder<TEntryPoint>

The non-null host builder to configure.

client TClient

The non-null client instance registered as a singleton. The instance is retained and shared; because it was supplied externally, the caller remains responsible for disposing it when needed.

Returns

EasyTestHostBuilder<TEntryPoint>

The same host builder, for chaining.

Type Parameters

TEntryPoint

The application entry-point type configured by the host builder.

TClient

The reference type registered and resolved directly from dependency injection.

UseAzureTestCredential(TestScenarioScopeBuilder, TestTokenCredential)

Replaces the application token credential for one test scenario.

public static TestScenarioScopeBuilder UseAzureTestCredential(this TestScenarioScopeBuilder builder, TestTokenCredential credential)

Parameters

builder TestScenarioScopeBuilder

The non-null scenario-scope builder to configure.

credential TestTokenCredential

The non-null credential instance registered as the scenario's singleton TokenCredential. The caller owns the retained instance and its recorded state.

Returns

TestScenarioScopeBuilder

The same scenario-scope builder, for chaining.

UseAzureTestCredential<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>, TestTokenCredential)

Replaces the application token credential for every test scenario.

public static EasyTestHostBuilder<TEntryPoint> UseAzureTestCredential<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder, TestTokenCredential credential) where TEntryPoint : class

Parameters

builder EasyTestHostBuilder<TEntryPoint>

The non-null host builder to configure.

credential TestTokenCredential

The non-null credential instance registered as the singleton TokenCredential. The instance is retained and shared; the caller owns it and any state it records.

Returns

EasyTestHostBuilder<TEntryPoint>

The same host builder, for chaining.

Type Parameters

TEntryPoint

The application entry-point type configured by the host builder.