mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-19 02:53:06 +08:00
Clean up
This commit is contained in:
@@ -114,7 +114,7 @@ namespace MQTTnet.Tests.Mockups
|
||||
{
|
||||
if (!IgnoreServerLogErrors && _serverErrors.Count > 0)
|
||||
{
|
||||
//throw new Exception($"Server had {_serverErrors.Count} errors (${string.Join(Environment.NewLine, _serverErrors)}).");
|
||||
throw new Exception($"Server had {_serverErrors.Count} errors (${string.Join(Environment.NewLine, _serverErrors)}).");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace MQTTnet.Tests.Mockups
|
||||
{
|
||||
if (!IgnoreClientLogErrors && _clientErrors.Count > 0)
|
||||
{
|
||||
//throw new Exception($"Client(s) had {_clientErrors.Count} errors (${string.Join(Environment.NewLine, _clientErrors)}).");
|
||||
throw new Exception($"Client(s) had {_clientErrors.Count} errors (${string.Join(Environment.NewLine, _clientErrors)}).");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -936,6 +936,8 @@ namespace MQTTnet.Tests
|
||||
{
|
||||
using (var testEnvironment = new TestEnvironment())
|
||||
{
|
||||
testEnvironment.IgnoreClientLogErrors = true;
|
||||
|
||||
_connected = new Dictionary<string, bool>();
|
||||
var options = new MqttServerOptionsBuilder();
|
||||
options.WithConnectionValidator(e => ConnectionValidationHandler(e));
|
||||
@@ -943,8 +945,6 @@ namespace MQTTnet.Tests
|
||||
|
||||
var events = new List<string>();
|
||||
|
||||
var connected = true;
|
||||
|
||||
server.ClientConnectedHandler = new MqttServerClientConnectedHandlerDelegate(_ =>
|
||||
{
|
||||
lock (events)
|
||||
@@ -972,15 +972,6 @@ namespace MQTTnet.Tests
|
||||
lock (events)
|
||||
{
|
||||
events.Add("x");
|
||||
connected = false;
|
||||
}
|
||||
});
|
||||
|
||||
c1.UseConnectedHandler(_ =>
|
||||
{
|
||||
lock (events)
|
||||
{
|
||||
connected = true;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1002,7 +993,6 @@ namespace MQTTnet.Tests
|
||||
|
||||
await Task.Delay(500);
|
||||
|
||||
|
||||
var flow = string.Join(string.Empty, events);
|
||||
Assert.AreEqual("cr", flow);
|
||||
|
||||
@@ -1018,16 +1008,6 @@ namespace MQTTnet.Tests
|
||||
|
||||
await Task.Delay(500);
|
||||
|
||||
/*if (!connected)
|
||||
{
|
||||
c1.ReconnectAsync().Wait();
|
||||
}
|
||||
|
||||
if (!c1.IsConnected)
|
||||
{
|
||||
c1.ReconnectAsync().Wait();
|
||||
}*/
|
||||
|
||||
flow = string.Join(string.Empty, events);
|
||||
Assert.AreEqual("cr", flow);
|
||||
|
||||
@@ -1037,7 +1017,6 @@ namespace MQTTnet.Tests
|
||||
|
||||
flow = string.Join(string.Empty, events);
|
||||
Assert.AreEqual("crr", flow);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user