Class TestcontainerModuleExtensions
- Namespace
- XBullet.EasyTesting.Testcontainers
- Assembly
- XBullet.EasyTesting.Testcontainers.dll
Registers supported preconfigured Testcontainers modules.
public static class TestcontainerModuleExtensions
- Inheritance
-
TestcontainerModuleExtensions
- Inherited Members
Remarks
Methods
UseAzurite(TestScenarioScopeBuilder)
Adds an Azurite container to one scenario.
public static TestScenarioScopeBuilder UseAzurite(this TestScenarioScopeBuilder builder)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
Returns
- TestScenarioScopeBuilder
The same builder, configured with resource name
Azuriteand configuration keyConnectionStrings:AzureStorage.
UseAzurite(TestScenarioScopeBuilder, Action<TestcontainerModuleOptions<AzuriteBuilder>>)
Adds a configured Azurite container to one scenario.
public static TestScenarioScopeBuilder UseAzurite(this TestScenarioScopeBuilder builder, Action<TestcontainerModuleOptions<AzuriteBuilder>> configure)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
configureAction<TestcontainerModuleOptions<AzuriteBuilder>>A non-null callback invoked synchronously once to change names or add native Azurite builder transformations. Transformations run once when the scenario creates its container.
Returns
- TestScenarioScopeBuilder
The same builder, configured for a lazy, scenario-owned Azurite container whose connection string is published after readiness.
UseAzurite<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>)
Adds an Azurite container to every scenario.
public static EasyTestHostBuilder<TEntryPoint> UseAzurite<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, configured to create an Azurite container named
Azuriteper scenario and publish its connection string asConnectionStrings:AzureStorage.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.
UseAzurite<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>, Action<TestcontainerModuleOptions<AzuriteBuilder>>)
Adds a configured Azurite container to every scenario.
public static EasyTestHostBuilder<TEntryPoint> UseAzurite<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder, Action<TestcontainerModuleOptions<AzuriteBuilder>> configure) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
configureAction<TestcontainerModuleOptions<AzuriteBuilder>>A non-null callback invoked synchronously once to change the resource name, configuration key, or add native Azurite builder transformations. Transformations run once per scenario.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, configured for a lazy, scenario-owned Azurite container whose connection string is published only after readiness.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.
UseKafka(TestScenarioScopeBuilder)
Adds a Kafka container to one scenario.
public static TestScenarioScopeBuilder UseKafka(this TestScenarioScopeBuilder builder)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
Returns
- TestScenarioScopeBuilder
The same builder, configured with resource name
Kafkaand configuration keyKafka:BootstrapServers.
UseKafka(TestScenarioScopeBuilder, Action<TestcontainerModuleOptions<KafkaBuilder>>)
Adds a configured Kafka container to one scenario.
public static TestScenarioScopeBuilder UseKafka(this TestScenarioScopeBuilder builder, Action<TestcontainerModuleOptions<KafkaBuilder>> configure)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
configureAction<TestcontainerModuleOptions<KafkaBuilder>>A non-null callback invoked synchronously once to change names or add native Kafka builder transformations. Transformations run once when the scenario creates its container.
Returns
- TestScenarioScopeBuilder
The same builder, configured for a lazy, scenario-owned Kafka container whose bootstrap address is published after readiness.
UseKafka<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>)
Adds a Kafka container to every scenario.
public static EasyTestHostBuilder<TEntryPoint> UseKafka<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, configured to create a Kafka container named
Kafkaper scenario and publish its bootstrap address asKafka:BootstrapServers.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.
UseKafka<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>, Action<TestcontainerModuleOptions<KafkaBuilder>>)
Adds a configured Kafka container to every scenario.
public static EasyTestHostBuilder<TEntryPoint> UseKafka<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder, Action<TestcontainerModuleOptions<KafkaBuilder>> configure) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
configureAction<TestcontainerModuleOptions<KafkaBuilder>>A non-null callback invoked synchronously once to change the resource name, configuration key, or add native Kafka builder transformations. Transformations run once per scenario.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, configured for a lazy, scenario-owned Kafka container whose bootstrap address is published only after readiness.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.
UsePostgreSql(TestScenarioScopeBuilder)
Adds a PostgreSQL container to one scenario.
public static TestScenarioScopeBuilder UsePostgreSql(this TestScenarioScopeBuilder builder)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
Returns
- TestScenarioScopeBuilder
The same builder, configured with resource name
PostgreSqland configuration keyConnectionStrings:PostgreSql.
UsePostgreSql(TestScenarioScopeBuilder, Action<TestcontainerModuleOptions<PostgreSqlBuilder>>)
Adds a configured PostgreSQL container to one scenario.
public static TestScenarioScopeBuilder UsePostgreSql(this TestScenarioScopeBuilder builder, Action<TestcontainerModuleOptions<PostgreSqlBuilder>> configure)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
configureAction<TestcontainerModuleOptions<PostgreSqlBuilder>>A non-null callback invoked synchronously once to change names or add native PostgreSQL builder transformations. Transformations run once when the scenario creates its container.
Returns
- TestScenarioScopeBuilder
The same builder, configured for a lazy, scenario-owned PostgreSQL container whose connection string is published after readiness.
UsePostgreSql<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>)
Adds a PostgreSQL container to every scenario.
public static EasyTestHostBuilder<TEntryPoint> UsePostgreSql<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, configured to create a PostgreSQL container named
PostgreSqlper scenario and publish its connection string asConnectionStrings:PostgreSql.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.
UsePostgreSql<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>, Action<TestcontainerModuleOptions<PostgreSqlBuilder>>)
Adds a configured PostgreSQL container to every scenario.
public static EasyTestHostBuilder<TEntryPoint> UsePostgreSql<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder, Action<TestcontainerModuleOptions<PostgreSqlBuilder>> configure) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
configureAction<TestcontainerModuleOptions<PostgreSqlBuilder>>A non-null callback invoked synchronously once to change the resource name, configuration key, or add native PostgreSQL builder transformations. Native transformations run once per scenario.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, configured for a lazy, scenario-owned PostgreSQL container whose connection string is published only after the native readiness strategy succeeds.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.
UseRabbitMq(TestScenarioScopeBuilder)
Adds a RabbitMQ container to one scenario.
public static TestScenarioScopeBuilder UseRabbitMq(this TestScenarioScopeBuilder builder)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
Returns
- TestScenarioScopeBuilder
The same builder, configured with resource name
RabbitMqand configuration keyConnectionStrings:RabbitMq.
UseRabbitMq(TestScenarioScopeBuilder, Action<TestcontainerModuleOptions<RabbitMqBuilder>>)
Adds a configured RabbitMQ container to one scenario.
public static TestScenarioScopeBuilder UseRabbitMq(this TestScenarioScopeBuilder builder, Action<TestcontainerModuleOptions<RabbitMqBuilder>> configure)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
configureAction<TestcontainerModuleOptions<RabbitMqBuilder>>A non-null callback invoked synchronously once to change names or add native RabbitMQ builder transformations. Transformations run once when the scenario creates its container.
Returns
- TestScenarioScopeBuilder
The same builder, configured for a lazy, scenario-owned RabbitMQ container whose connection string is published after readiness.
UseRabbitMq<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>)
Adds a RabbitMQ container to every scenario.
public static EasyTestHostBuilder<TEntryPoint> UseRabbitMq<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, configured to create a RabbitMQ container named
RabbitMqper scenario and publish its connection string asConnectionStrings:RabbitMq.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.
UseRabbitMq<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>, Action<TestcontainerModuleOptions<RabbitMqBuilder>>)
Adds a configured RabbitMQ container to every scenario.
public static EasyTestHostBuilder<TEntryPoint> UseRabbitMq<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder, Action<TestcontainerModuleOptions<RabbitMqBuilder>> configure) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
configureAction<TestcontainerModuleOptions<RabbitMqBuilder>>A non-null callback invoked synchronously once to change the resource name, configuration key, or add native RabbitMQ builder transformations. Transformations run once per scenario.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, configured for a lazy, scenario-owned RabbitMQ container whose connection string is published only after readiness.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.
UseRedis(TestScenarioScopeBuilder)
Adds a Redis container to one scenario.
public static TestScenarioScopeBuilder UseRedis(this TestScenarioScopeBuilder builder)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
Returns
- TestScenarioScopeBuilder
The same builder, configured with resource name
Redisand configuration keyConnectionStrings:Redis.
UseRedis(TestScenarioScopeBuilder, Action<TestcontainerModuleOptions<RedisBuilder>>)
Adds a configured Redis container to one scenario.
public static TestScenarioScopeBuilder UseRedis(this TestScenarioScopeBuilder builder, Action<TestcontainerModuleOptions<RedisBuilder>> configure)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
configureAction<TestcontainerModuleOptions<RedisBuilder>>A non-null callback invoked synchronously once to change names or add native Redis builder transformations. Transformations run once when the scenario creates its container.
Returns
- TestScenarioScopeBuilder
The same builder, configured for a lazy, scenario-owned Redis container whose connection string is published after readiness.
UseRedis<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>)
Adds a Redis container to every scenario.
public static EasyTestHostBuilder<TEntryPoint> UseRedis<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, configured to create a Redis container named
Redisper scenario and publish its connection string asConnectionStrings:Redis.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.
UseRedis<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>, Action<TestcontainerModuleOptions<RedisBuilder>>)
Adds a configured Redis container to every scenario.
public static EasyTestHostBuilder<TEntryPoint> UseRedis<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder, Action<TestcontainerModuleOptions<RedisBuilder>> configure) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
configureAction<TestcontainerModuleOptions<RedisBuilder>>A non-null callback invoked synchronously once to change the resource name, configuration key, or add native Redis builder transformations. Transformations run once per scenario.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, configured for a lazy, scenario-owned Redis container whose connection string is published only after readiness.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.
UseServiceBusEmulator(TestScenarioScopeBuilder, Action<TestcontainerModuleOptions<ServiceBusBuilder>>)
Adds a configured Azure Service Bus emulator container to one scenario.
public static TestScenarioScopeBuilder UseServiceBusEmulator(this TestScenarioScopeBuilder builder, Action<TestcontainerModuleOptions<ServiceBusBuilder>> configure)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
configureAction<TestcontainerModuleOptions<ServiceBusBuilder>>A non-null callback invoked synchronously once to change names or add native Service Bus builder transformations. Transformations run once when the scenario creates its container. The caller is responsible for configuring required license acceptance on the native builder.
Returns
- TestScenarioScopeBuilder
The same builder, configured for a lazy, scenario-owned Service Bus emulator whose connection string is published after readiness.
UseServiceBusEmulator(TestScenarioScopeBuilder, bool)
Adds an Azure Service Bus emulator container to one scenario.
public static TestScenarioScopeBuilder UseServiceBusEmulator(this TestScenarioScopeBuilder builder, bool acceptLicenseAgreement)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
acceptLicenseAgreementbooltrue only when the caller accepts the emulator's license terms; false leaves them unaccepted and can prevent container startup.
Returns
- TestScenarioScopeBuilder
The same builder, configured with resource name
ServiceBusand configuration keyConnectionStrings:ServiceBus.
UseServiceBusEmulator<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>, Action<TestcontainerModuleOptions<ServiceBusBuilder>>)
Adds a configured Azure Service Bus emulator container to every scenario.
public static EasyTestHostBuilder<TEntryPoint> UseServiceBusEmulator<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder, Action<TestcontainerModuleOptions<ServiceBusBuilder>> configure) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
configureAction<TestcontainerModuleOptions<ServiceBusBuilder>>A non-null callback invoked synchronously once to change the resource name, configuration key, or add native Service Bus builder transformations. Transformations run once per scenario. The caller is responsible for configuring required license acceptance on the native builder.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, configured for a lazy, scenario-owned Service Bus emulator whose connection string is published only after readiness.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.
UseServiceBusEmulator<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>, bool)
Adds an Azure Service Bus emulator container to every scenario.
public static EasyTestHostBuilder<TEntryPoint> UseServiceBusEmulator<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder, bool acceptLicenseAgreement) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
acceptLicenseAgreementbooltrue only when the caller accepts the emulator's license terms; false leaves them unaccepted and can prevent container startup.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, configured to create a Service Bus emulator named
ServiceBusper scenario and publish its connection string asConnectionStrings:ServiceBus.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.
UseSqlServer(TestScenarioScopeBuilder)
Adds a SQL Server container to one scenario.
public static TestScenarioScopeBuilder UseSqlServer(this TestScenarioScopeBuilder builder)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
Returns
- TestScenarioScopeBuilder
The same builder, configured with resource name
SqlServerand configuration keyConnectionStrings:SqlServer.
UseSqlServer(TestScenarioScopeBuilder, Action<TestcontainerModuleOptions<MsSqlBuilder>>)
Adds a configured SQL Server container to one scenario.
public static TestScenarioScopeBuilder UseSqlServer(this TestScenarioScopeBuilder builder, Action<TestcontainerModuleOptions<MsSqlBuilder>> configure)
Parameters
builderTestScenarioScopeBuilderThe non-null scenario-scope builder to configure.
configureAction<TestcontainerModuleOptions<MsSqlBuilder>>A non-null callback invoked synchronously once to change names or add native SQL Server builder transformations. Transformations run once when the scenario creates its container.
Returns
- TestScenarioScopeBuilder
The same builder, configured for a lazy, scenario-owned SQL Server container whose connection string is published after readiness.
UseSqlServer<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>)
Adds a SQL Server container to every scenario.
public static EasyTestHostBuilder<TEntryPoint> UseSqlServer<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, configured to create a SQL Server container named
SqlServerper scenario and publish its connection string asConnectionStrings:SqlServer.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.
UseSqlServer<TEntryPoint>(EasyTestHostBuilder<TEntryPoint>, Action<TestcontainerModuleOptions<MsSqlBuilder>>)
Adds a configured SQL Server container to every scenario.
public static EasyTestHostBuilder<TEntryPoint> UseSqlServer<TEntryPoint>(this EasyTestHostBuilder<TEntryPoint> builder, Action<TestcontainerModuleOptions<MsSqlBuilder>> configure) where TEntryPoint : class
Parameters
builderEasyTestHostBuilder<TEntryPoint>The non-null host builder to configure.
configureAction<TestcontainerModuleOptions<MsSqlBuilder>>A non-null callback invoked synchronously once to change the resource name, configuration key, or add native SQL Server builder transformations. Transformations run once per scenario.
Returns
- EasyTestHostBuilder<TEntryPoint>
The same builder, configured for a lazy, scenario-owned SQL Server container whose connection string is published only after readiness.
Type Parameters
TEntryPointThe application entry-point type configured by the host builder.