This commit is contained in:
Lucas Rosa
2019-10-29 12:48:04 -03:00
parent e3f6b579b2
commit 5c25905510
6 changed files with 4 additions and 101 deletions
@@ -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)}).");
}
}
}
+2 -23
View File
@@ -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);
}
}