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
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
clientTClientThe 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
TClientThe 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
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
clientTClientThe 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
TEntryPointThe application entry-point type configured by the host builder.
TClientThe 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
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
credentialTestTokenCredentialThe 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
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
credentialTestTokenCredentialThe 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
TEntryPointThe application entry-point type configured by the host builder.