Show / Hide Table of Contents

    Class MockedMqttClient

    A mocked implementation of MQTTnet.Client.IMqttClient from MQTTnet that connects with an in-memory broker.

    Inheritance
    object
    MockedMqttClient
    Implements
    IMqttClient
    IDisposable
    Inherited Members
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.ReferenceEquals(object, object)
    object.ToString()
    Namespace: Silverback.Messaging.Broker.Mqtt.Mocks
    Assembly: Silverback.Integration.MQTT.Testing.dll
    Syntax
    public sealed class MockedMqttClient : IMqttClient, IDisposable

    Constructors

    | Improve this doc View source

    MockedMqttClient(IInMemoryMqttBroker, IMockedMqttOptions)

    Initializes a new instance of the MockedMqttClient class.

    Declaration
    public MockedMqttClient(IInMemoryMqttBroker broker, IMockedMqttOptions mockOptions)
    Parameters
    Type Name Description
    IInMemoryMqttBroker broker

    The IInMemoryMqttBroker.

    IMockedMqttOptions mockOptions

    The IMockedMqttOptions.

    Properties

    | Improve this doc View source

    IsConnected

    A mocked implementation of MQTTnet.Client.IMqttClient from MQTTnet that connects with an in-memory broker.

    Declaration
    public bool IsConnected { get; }
    Property Value
    Type Description
    bool
    | Improve this doc View source

    IsConsumerConnected

    Gets a value indicating whether the client is connected and a message handler is bound to it.

    Declaration
    public bool IsConsumerConnected { get; }
    Property Value
    Type Description
    bool
    | Improve this doc View source

    Options

    A mocked implementation of MQTTnet.Client.IMqttClient from MQTTnet that connects with an in-memory broker.

    Declaration
    public MqttClientOptions? Options { get; }
    Property Value
    Type Description
    MqttClientOptions

    Methods

    | Improve this doc View source

    ConnectAsync(MqttClientOptions, CancellationToken)

    A mocked implementation of MQTTnet.Client.IMqttClient from MQTTnet that connects with an in-memory broker.

    Declaration
    public Task<MqttClientConnectResult> ConnectAsync(MqttClientOptions options, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    MqttClientOptions options
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<MqttClientConnectResult>
    | Improve this doc View source

    DisconnectAsync(MqttClientDisconnectOptions, CancellationToken)

    A mocked implementation of MQTTnet.Client.IMqttClient from MQTTnet that connects with an in-memory broker.

    Declaration
    public Task DisconnectAsync(MqttClientDisconnectOptions options, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    MqttClientDisconnectOptions options
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Improve this doc View source

    Dispose()

    Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

    Declaration
    public void Dispose()
    | Improve this doc View source

    PingAsync(CancellationToken)

    A mocked implementation of MQTTnet.Client.IMqttClient from MQTTnet that connects with an in-memory broker.

    Declaration
    public Task PingAsync(CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Improve this doc View source

    PublishAsync(MqttApplicationMessage, CancellationToken)

    A mocked implementation of MQTTnet.Client.IMqttClient from MQTTnet that connects with an in-memory broker.

    Declaration
    public Task<MqttClientPublishResult> PublishAsync(MqttApplicationMessage applicationMessage, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    MqttApplicationMessage applicationMessage
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<MqttClientPublishResult>
    | Improve this doc View source

    SendExtendedAuthenticationExchangeDataAsync(MqttExtendedAuthenticationExchangeData, CancellationToken)

    A mocked implementation of MQTTnet.Client.IMqttClient from MQTTnet that connects with an in-memory broker.

    Declaration
    public Task SendExtendedAuthenticationExchangeDataAsync(MqttExtendedAuthenticationExchangeData data, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    MqttExtendedAuthenticationExchangeData data
    CancellationToken cancellationToken
    Returns
    Type Description
    Task
    | Improve this doc View source

    SubscribeAsync(MqttClientSubscribeOptions, CancellationToken)

    A mocked implementation of MQTTnet.Client.IMqttClient from MQTTnet that connects with an in-memory broker.

    Declaration
    public Task<MqttClientSubscribeResult> SubscribeAsync(MqttClientSubscribeOptions options, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    MqttClientSubscribeOptions options
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<MqttClientSubscribeResult>
    | Improve this doc View source

    UnsubscribeAsync(MqttClientUnsubscribeOptions, CancellationToken)

    A mocked implementation of MQTTnet.Client.IMqttClient from MQTTnet that connects with an in-memory broker.

    Declaration
    public Task<MqttClientUnsubscribeResult> UnsubscribeAsync(MqttClientUnsubscribeOptions options, CancellationToken cancellationToken = default)
    Parameters
    Type Name Description
    MqttClientUnsubscribeOptions options
    CancellationToken cancellationToken
    Returns
    Type Description
    Task<MqttClientUnsubscribeResult>

    Events

    | Improve this doc View source

    ApplicationMessageReceivedAsync

    A mocked implementation of MQTTnet.Client.IMqttClient from MQTTnet that connects with an in-memory broker.

    Declaration
    public event Func<MqttApplicationMessageReceivedEventArgs, Task>? ApplicationMessageReceivedAsync
    Event Type
    Type Description
    Func<MqttApplicationMessageReceivedEventArgs, Task>
    | Improve this doc View source

    ConnectedAsync

    A mocked implementation of MQTTnet.Client.IMqttClient from MQTTnet that connects with an in-memory broker.

    Declaration
    public event Func<MqttClientConnectedEventArgs, Task>? ConnectedAsync
    Event Type
    Type Description
    Func<MqttClientConnectedEventArgs, Task>
    | Improve this doc View source

    ConnectingAsync

    A mocked implementation of MQTTnet.Client.IMqttClient from MQTTnet that connects with an in-memory broker.

    Declaration
    public event Func<MqttClientConnectingEventArgs, Task>? ConnectingAsync
    Event Type
    Type Description
    Func<MqttClientConnectingEventArgs, Task>
    | Improve this doc View source

    DisconnectedAsync

    A mocked implementation of MQTTnet.Client.IMqttClient from MQTTnet that connects with an in-memory broker.

    Declaration
    public event Func<MqttClientDisconnectedEventArgs, Task>? DisconnectedAsync
    Event Type
    Type Description
    Func<MqttClientDisconnectedEventArgs, Task>
    | Improve this doc View source

    InspectPacketAsync

    A mocked implementation of MQTTnet.Client.IMqttClient from MQTTnet that connects with an in-memory broker.

    Declaration
    public event Func<InspectMqttPacketEventArgs, Task>? InspectPacketAsync
    Event Type
    Type Description
    Func<InspectMqttPacketEventArgs, Task>

    Implements

    MQTTnet.Client.IMqttClient
    IDisposable
    • Improve this doc
    • View source
    GitHub E-Mail
    ↑ Back to top © 2020 Sergio Aquilini