Class InboundEnvelopeBuilder<TMessage>
- Namespace
- Silverback.Messaging.Messages
- Assembly
- Silverback.Integration.Testing.dll
Creates the IInboundEnvelope<TMessage> instances to be used for testing.
public class InboundEnvelopeBuilder<TMessage> where TMessage : class
Type Parameters
TMessageThe type of the wrapped message.
- Inheritance
-
InboundEnvelopeBuilder<TMessage>
- Inherited Members
Constructors
InboundEnvelopeBuilder()
public InboundEnvelopeBuilder()
Methods
AddHeader(MessageHeader)
Adds a header to the envelope.
public InboundEnvelopeBuilder<TMessage> AddHeader(MessageHeader header)
Parameters
headerMessageHeaderThe header to be added.
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
AddHeader(string, object?)
Adds a header to the envelope.
public InboundEnvelopeBuilder<TMessage> AddHeader(string name, object? value)
Parameters
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
AddHeader(string, string?)
Adds a header to the envelope.
public InboundEnvelopeBuilder<TMessage> AddHeader(string name, string? value)
Parameters
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
AddOrReplaceHeader(string, object?)
Adds a header to the envelope.
public InboundEnvelopeBuilder<TMessage> AddOrReplaceHeader(string name, object? value)
Parameters
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
AddOrReplaceHeader(string, string?)
Adds a header to the envelope.
public InboundEnvelopeBuilder<TMessage> AddOrReplaceHeader(string name, string? value)
Parameters
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
Build()
Builds the IInboundEnvelope<TMessage> instance.
public IInboundEnvelope<TMessage> Build()
Returns
- IInboundEnvelope<TMessage>
The IInboundEnvelope<TMessage> instance.
WithConsumer(IConsumer?)
Sets the consumer that consumed the message.
public InboundEnvelopeBuilder<TMessage> WithConsumer(IConsumer? consumer)
Parameters
consumerIConsumerThe consumer.
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
WithEndpoint(ConsumerEndpoint?)
Sets the endpoint from which the message was consumed.
public InboundEnvelopeBuilder<TMessage> WithEndpoint(ConsumerEndpoint? endpoint)
Parameters
endpointConsumerEndpointThe endpoint.
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
WithHeaders(IReadOnlyCollection<MessageHeader>?)
Sets the headers to be added to the envelope.
public InboundEnvelopeBuilder<TMessage> WithHeaders(IReadOnlyCollection<MessageHeader>? headers)
Parameters
headersIReadOnlyCollection<MessageHeader>The headers to be added.
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
WithIdentifier(IBrokerMessageIdentifier)
Sets the identifier of the message.
public InboundEnvelopeBuilder<TMessage> WithIdentifier(IBrokerMessageIdentifier identifier)
Parameters
identifierIBrokerMessageIdentifierThe identifier.
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
WithMessage(TMessage?)
Sets the message to be wrapped by the envelope.
public InboundEnvelopeBuilder<TMessage> WithMessage(TMessage? message)
Parameters
messageTMessageThe message to be wrapped.
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.
WithRawMessage(Stream?)
Sets the raw message to be wrapped by the envelope.
public InboundEnvelopeBuilder<TMessage> WithRawMessage(Stream? rawMessage)
Parameters
rawMessageStreamThe raw message to be wrapped.
Returns
- InboundEnvelopeBuilder<TMessage>
The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.