Table of Contents

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

TMessage

The 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

header MessageHeader

The 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

name string

The name of the header.

value object

The value of the header.

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

name string

The name of the header.

value string

The value of the header.

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

name string

The name of the header.

value object

The value of the header.

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

name string

The name of the header.

value string

The value of the header.

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

consumer IConsumer

The 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

endpoint ConsumerEndpoint

The 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

headers IReadOnlyCollection<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

identifier IBrokerMessageIdentifier

The 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

message TMessage

The 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

rawMessage Stream

The raw message to be wrapped.

Returns

InboundEnvelopeBuilder<TMessage>

The InboundEnvelopeBuilder<TMessage> so that additional calls can be chained.