Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
chkr1011 committed Apr 11, 2024
1 parent ae5e038 commit 7f5c437
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public async Task ConnectTimeout_Throws_Exception()
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!");
}
Expand Down Expand Up @@ -175,7 +175,7 @@ public async Task No_Unobserved_Exception()
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
{
Expand Down Expand Up @@ -240,9 +240,9 @@ public async Task Throw_Proper_Exception_When_Not_Connected()
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;
}
Expand Down

0 comments on commit 7f5c437

Please sign in to comment.