From e25edefd2f420a33bf7dfff42808eb18e6958875 Mon Sep 17 00:00:00 2001 From: Steve Hamblett Date: Mon, 12 Aug 2024 13:40:20 +0100 Subject: [PATCH] Issue 559 --- test/mqtt_client_base_test.dart | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/test/mqtt_client_base_test.dart b/test/mqtt_client_base_test.dart index d7b8521..44fd133 100644 --- a/test/mqtt_client_base_test.dart +++ b/test/mqtt_client_base_test.dart @@ -525,7 +525,7 @@ void main() { Protocol.version = MqttClientConstants.mqttV31ProtocolVersion; Protocol.name = MqttClientConstants.mqttV31ProtocolName; }); - test('Protocol with connect message', () { + test('Protocol set with connect message', () { Protocol.version = MqttClientConstants.mqttV31ProtocolVersion; Protocol.name = MqttClientConstants.mqttV31ProtocolName; final client = MqttClient('localhost', 'abcd'); @@ -541,6 +541,17 @@ void main() { expect(client.connectionMessage?.variableHeader?.protocolName, MqttClientConstants.mqttV311ProtocolName); }); + test('Protocol set on connect message', () { + Protocol.version = MqttClientConstants.mqttV31ProtocolVersion; + Protocol.name = MqttClientConstants.mqttV31ProtocolName; + expect(Protocol.version, MqttClientConstants.mqttV31ProtocolVersion); + expect(Protocol.name, MqttClientConstants.mqttV31ProtocolName); + MqttConnectMessage() + ..withProtocolName(MqttClientConstants.mqttV311ProtocolName) + ..withProtocolVersion(MqttClientConstants.mqttV311ProtocolVersion); + expect(Protocol.version, MqttClientConstants.mqttV311ProtocolVersion); + expect(Protocol.name, MqttClientConstants.mqttV311ProtocolName); + }); test('Byte Buffer', () { final uBuff = typed.Uint8Buffer(10); final uBuff1 = typed.Uint8Buffer(10);