Interface IMqttTestingHelper
Inherited Members
Namespace: Silverback.Testing
Assembly: Silverback.Integration.MQTT.Testing.dll
Syntax
public interface IMqttTestingHelper : ITestingHelper<MqttBroker>
Methods
| Improve this doc View sourceGetClientSession(String)
Gets the IClientSession of the specified client.
Declaration
IClientSession GetClientSession(string clientId)
Parameters
Type | Name | Description |
---|---|---|
System.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>).
GetMessages(String)
Gets the messages that have been published to the specified topic.
Declaration
IReadOnlyList<MqttApplicationMessage> GetMessages(string topic)
Parameters
Type | Name | Description |
---|---|---|
System.String | topic | The name of the topic. |
Returns
Type | Description |
---|---|
System.Collections.Generic.IReadOnlyList<MQTTnet.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>).