Class TestObservabilityExtensions
- Namespace
- XBullet.EasyTesting.Observability
- Assembly
- XBullet.EasyTesting.Observability.dll
Adds observability capture to integration-test scenarios.
public static class TestObservabilityExtensions
- Inheritance
-
TestObservabilityExtensions
- Inherited Members
Methods
GetObservability<TEntryPoint>(TestScenarioScope<TEntryPoint>, string)
Gets the named observability resource from a scenario.
public static TestObservability GetObservability<TEntryPoint>(this TestScenarioScope<TEntryPoint> scope, string resourceName = "Observability") where TEntryPoint : class
Parameters
scopeTestScenarioScope<TEntryPoint>The non-null, active scenario scope containing the resource.
resourceNamestringThe non-empty registered resource name, matched case-insensitively. The default is
Observability.
Returns
- TestObservability
The scenario-owned observability resource. The caller may use it while the scope is active but must not dispose or retain it beyond scope disposal.
Type Parameters
TEntryPointThe application entry-point type hosted by the scenario scope.
UseObservability(TestScenarioScopeBuilder)
Adds a fresh observability resource to one scenario.
public static TestScenarioScopeBuilder UseObservability(this TestScenarioScopeBuilder builder)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
Returns
- TestScenarioScopeBuilder
The same builder, for chaining, with a resource named
Observability, default limits, system time, and no source or meter filters.
UseObservability(TestScenarioScopeBuilder, Action<TestObservabilityOptions>)
Adds configured observability to one scenario.
public static TestScenarioScopeBuilder UseObservability(this TestScenarioScopeBuilder builder, Action<TestObservabilityOptions> configure)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
configureAction<TestObservabilityOptions>A non-null callback retained until scope creation, then invoked once with new mutable options. It must not retain the options beyond invocation.
Returns
- TestScenarioScopeBuilder
The same builder, for chaining, using resource name
Observability.
UseObservability(TestScenarioScopeBuilder, string, Action<TestObservabilityOptions>?)
Adds named observability to one scenario.
public static TestScenarioScopeBuilder UseObservability(this TestScenarioScopeBuilder builder, string resourceName, Action<TestObservabilityOptions>? configure)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
resourceNamestringThe non-empty, case-insensitively unique resource name used for lookup and diagnostics.
configureAction<TestObservabilityOptions>An optional callback retained until scope creation, then invoked once with new mutable options, or null to use defaults. It must not retain the options beyond invocation.
Returns
- TestScenarioScopeBuilder
The same builder, for chaining. The scenario owns and disposes the resource.
UseObservability<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>)
Adds a fresh observability resource to every scenario created by the host.
public static EasyTestHostBuilder<TEntryPoint> UseObservability<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, for chaining. Each scenario receives a resource named
Observabilitywith default limits, system time, and no source or meter filters.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.
UseObservability<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>, Action<TestObservabilityOptions>)
Adds configured observability to every scenario created by the host.
public static EasyTestHostBuilder<TEntryPoint> UseObservability<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder, Action<TestObservabilityOptions> configure) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
configureAction<TestObservabilityOptions>A non-null callback retained and invoked once for each scenario with new mutable options. It must not retain the options beyond invocation.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, for chaining, using resource name
Observability.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.
UseObservability<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>, string, Action<TestObservabilityOptions>?)
Adds named observability to every scenario created by the host.
public static EasyTestHostBuilder<TEntryPoint> UseObservability<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder, string resourceName, Action<TestObservabilityOptions>? configure) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
resourceNamestringThe non-empty, case-insensitively unique scenario resource name used for lookup and diagnostics.
configureAction<TestObservabilityOptions>An optional callback retained and invoked once for each scenario with new mutable options, or null to use defaults. It must not retain the options beyond invocation.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, for chaining. Each scenario owns and disposes its resource.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.