Show / Hide Table of Contents

    Interface IMqttTestingHelper

    Exposes some helper methods and shortcuts to simplify testing.

    Inherited Members
    ITestingHelper<MqttBroker>.Broker
    ITestingHelper<MqttBroker>.Spy
    ITestingHelper<MqttBroker>.WaitUntilConnectedAsync(TimeSpan?)
    ITestingHelper<MqttBroker>.WaitUntilConnectedAsync(bool, TimeSpan?)
    ITestingHelper<MqttBroker>.WaitUntilAllMessagesAreConsumedAsync(TimeSpan?)
    ITestingHelper<MqttBroker>.WaitUntilAllMessagesAreConsumedAsync(bool, TimeSpan?)
    ITestingHelper<MqttBroker>.WaitUntilOutboxIsEmptyAsync(CancellationToken)
    ITestingHelper<MqttBroker>.IsOutboxEmptyAsync()
    Namespace: Silverback.Testing
    Assembly: Silverback.Integration.MQTT.Testing.dll
    Syntax
    public interface IMqttTestingHelper : ITestingHelper<MqttBroker>

    Methods

    | Improve this doc View source

    GetClientSession(string)

    Gets the IClientSession of the specified client.

    Declaration
    IClientSession GetClientSession(string clientId)
    Parameters
    Type Name Description
    string clientId

    The client id.

    Returns
    Type Description
    IClientSession

    The IClientSession.

    Remarks

    This method works with the mocked MQTT broker only. See UseMockedMqtt(ISilverbackBuilder, Action<IMockedMqttOptionsBuilder>?) or AddMockedMqtt(IBrokerOptionsBuilder, Action<IMockedMqttOptionsBuilder>?).

    | Improve this doc View source

    GetMessages(string)

    Gets the messages that have been published to the specified topic.

    Declaration
    IReadOnlyList<MqttApplicationMessage> GetMessages(string topic)
    Parameters
    Type Name Description
    string topic

    The name of the topic.

    Returns
    Type Description
    IReadOnlyList<MqttApplicationMessage>

    The messages published to the topic.

    Remarks

    This method works with the mocked MQTT broker only. See UseMockedMqtt(ISilverbackBuilder, Action<IMockedMqttOptionsBuilder>?) or AddMockedMqtt(IBrokerOptionsBuilder, Action<IMockedMqttOptionsBuilder>?).

    • Improve this doc
    • View source
    In this article
    • Methods
      • GetClientSession(string)
      • GetMessages(string)
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini