Class RabbitMqBroker
- Namespace
- ProtoTest.Messaging.RabbitMq.Testcontainers
- Assembly
- ProtoTest.Messaging.RabbitMq.Testcontainers.dll
A RabbitMQ container owned by the whole run: started once for the suite and released when the host
is disposed, after the run has stopped and the reports are written. Register it with
AddInfrastructure and hand its connection string to the application and to the tests so both
work against the same broker - the same shape as the PostgreSQL container.
public sealed class RabbitMqBroker : ProtoContainerResource<RabbitMqContainer>, IProtoConnectionInfrastructure, IProtoConfiguredInfrastructure, IProtoInfrastructure, IProtoResource, IProtoStartupEvidence, IAsyncDisposable
- Inheritance
-
ProtoContainerResource<RabbitMqContainer>RabbitMqBroker
- Implements
- Inherited Members
- Extension Methods
Properties
Description
Gets a single line describing the resource for the trace, report and viewer.
public override string Description { get; }
Property Value
Id
Gets the stable identity of the resource, for example customer:42.
public override string Id { get; }
Property Value
Kind
Gets the resource kind, for example database or entity.
public override string Kind { get; }
Property Value
Methods
Container(Action<RabbitMqBuilder>?)
Creates the resource without starting it; the host starts it with the run.
public static RabbitMqBroker Container(Action<RabbitMqBuilder>? configure = null)
Parameters
configureAction<RabbitMqBuilder>
Returns
Start(Action<RabbitMqBuilder>?)
Starts a container now, or throws with the reason it could not start.
public static RabbitMqBroker Start(Action<RabbitMqBuilder>? configure = null)
Parameters
configureAction<RabbitMqBuilder>
Returns
TryStart(Action<RabbitMqBuilder>?)
Starts a container, reporting why it could not start instead of throwing - a machine without a container runtime should be able to fall back or skip rather than fail the run.
public static ContainerStartResult<RabbitMqBroker> TryStart(Action<RabbitMqBuilder>? configure = null)
Parameters
configureAction<RabbitMqBuilder>