Class OutboundEnvelopeBuilder<TMessage>
Creates the IOutboundEnvelope<TMessage> instances to be used for testing.
Inherited Members
Namespace: Silverback.Messaging.Messages
Assembly: Silverback.Integration.Testing.dll
Syntax
public class OutboundEnvelopeBuilder<TMessage> where TMessage : class
Type Parameters
| Name | Description |
|---|---|
| TMessage | The type of the wrapped message. |
Constructors
OutboundEnvelopeBuilder()
Creates the IOutboundEnvelope<TMessage> instances to be used for testing.
Declaration
public OutboundEnvelopeBuilder()
Methods
AddHeader(MessageHeader)
Adds a header to the envelope.
Declaration
public OutboundEnvelopeBuilder<TMessage> AddHeader(MessageHeader header)
Parameters
| Type | Name | Description |
|---|---|---|
| MessageHeader | header | The header to be added. |
Returns
| Type | Description |
|---|---|
| OutboundEnvelopeBuilder<TMessage> | The OutboundEnvelopeBuilder<TMessage> so that additional calls can be chained. |
AddHeader(string, string?)
Adds a header to the envelope.
Declaration
public OutboundEnvelopeBuilder<TMessage> AddHeader(string name, string? value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | name | The name of the header. |
| string | value | The value of the header. |
Returns
| Type | Description |
|---|---|
| OutboundEnvelopeBuilder<TMessage> | The OutboundEnvelopeBuilder<TMessage> so that additional calls can be chained. |
Build()
Builds the IOutboundEnvelope<TMessage> instance.
Declaration
public IOutboundEnvelope<TMessage> Build()
Returns
| Type | Description |
|---|---|
| IOutboundEnvelope<TMessage> | The IOutboundEnvelope<TMessage> instance. |
WithEndpointConfiguration(ProducerEndpointConfiguration?)
Sets the endpoint to be used to produce the message.
Declaration
public OutboundEnvelopeBuilder<TMessage> WithEndpointConfiguration(ProducerEndpointConfiguration? endpointConfiguration)
Parameters
| Type | Name | Description |
|---|---|---|
| ProducerEndpointConfiguration | endpointConfiguration | The endpoint configuration. |
Returns
| Type | Description |
|---|---|
| OutboundEnvelopeBuilder<TMessage> | The OutboundEnvelopeBuilder<TMessage> so that additional calls can be chained. |
WithHeaders(IReadOnlyCollection<MessageHeader>?)
Sets the headers to be added to the envelope.
Declaration
public OutboundEnvelopeBuilder<TMessage> WithHeaders(IReadOnlyCollection<MessageHeader>? headers)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyCollection<MessageHeader> | headers | The headers to be added. |
Returns
| Type | Description |
|---|---|
| OutboundEnvelopeBuilder<TMessage> | The OutboundEnvelopeBuilder<TMessage> so that additional calls can be chained. |
WithMessage(TMessage?)
Sets the message to be wrapped by the envelope.
Declaration
public OutboundEnvelopeBuilder<TMessage> WithMessage(TMessage? message)
Parameters
| Type | Name | Description |
|---|---|---|
| TMessage | message | The message to be wrapped. |
Returns
| Type | Description |
|---|---|
| OutboundEnvelopeBuilder<TMessage> | The OutboundEnvelopeBuilder<TMessage> so that additional calls can be chained. |
WithProducer(IProducer?)
Sets the producer to be used to produce the message.
Declaration
public OutboundEnvelopeBuilder<TMessage> WithProducer(IProducer? producer)
Parameters
| Type | Name | Description |
|---|---|---|
| IProducer | producer | The producer. |
Returns
| Type | Description |
|---|---|
| OutboundEnvelopeBuilder<TMessage> | The OutboundEnvelopeBuilder<TMessage> so that additional calls can be chained. |