From 7f5c437c46dd52ecb1d53dfc8ea9fb8ff46caf5d Mon Sep 17 00:00:00 2001 From: christian <6939810+chkr1011@users.noreply.github.com> Date: Thu, 11 Apr 2024 22:26:39 +0200 Subject: [PATCH] Fix unit tests --- .../Clients/MqttClient/MqttClient_Connection_Tests.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Source/MQTTnet.Tests/Clients/MqttClient/MqttClient_Connection_Tests.cs b/Source/MQTTnet.Tests/Clients/MqttClient/MqttClient_Connection_Tests.cs index b49417ac..cb7b2d23 100644 --- a/Source/MQTTnet.Tests/Clients/MqttClient/MqttClient_Connection_Tests.cs +++ b/Source/MQTTnet.Tests/Clients/MqttClient/MqttClient_Connection_Tests.cs @@ -65,7 +65,7 @@ namespace MQTTnet.Tests.Clients.MqttClient return CompletedTask.Instance; }; - await client.ConnectAsync(new MqttClientOptionsBuilder().WithTcpServer("1.2.3.4").Build()); + await client.ConnectAsync(new MqttClientOptionsBuilder().WithTcpServer("127.0.0.1").Build()); Assert.Fail("Must fail!"); } @@ -175,7 +175,7 @@ namespace MQTTnet.Tests.Clients.MqttClient testEnvironment.IgnoreClientLogErrors = true; var client = testEnvironment.CreateClient(); - var options = new MqttClientOptionsBuilder().WithTcpServer("127.0.0.1").WithTimeout(TimeSpan.FromSeconds(2)).Build(); + var options = new MqttClientOptionsBuilder().WithTcpServer("1.2.3.4").WithTimeout(TimeSpan.FromSeconds(2)).Build(); try { @@ -240,9 +240,9 @@ namespace MQTTnet.Tests.Clients.MqttClient await mqttClient.SubscribeAsync("test", MqttQualityOfServiceLevel.AtLeastOnce); } } - catch (MqttCommunicationException exception) + catch (MqttClientNotConnectedException exception) { - if (exception.Message == "The client is not connected.") + if (exception.Message == "The MQTT client is not connected.") { return; }