diff --git a/Source/MQTTnet/Diagnostics/MqttNetLogMessage.cs b/Source/MQTTnet/Diagnostics/MqttNetLogMessage.cs index 1ab1b4c..285dc00 100644 --- a/Source/MQTTnet/Diagnostics/MqttNetLogMessage.cs +++ b/Source/MQTTnet/Diagnostics/MqttNetLogMessage.cs @@ -2,7 +2,7 @@ namespace MQTTnet.Diagnostics { - public class MqttNetLogMessage + public sealed class MqttNetLogMessage { public string LogId { get; set; } diff --git a/Tests/MQTTnet.Core.Tests/Mockups/TestEnvironment.cs b/Tests/MQTTnet.Core.Tests/Mockups/TestEnvironment.cs index e2d15fd..8a36cd1 100644 --- a/Tests/MQTTnet.Core.Tests/Mockups/TestEnvironment.cs +++ b/Tests/MQTTnet.Core.Tests/Mockups/TestEnvironment.cs @@ -46,7 +46,10 @@ namespace MQTTnet.Tests.Mockups ServerLogger.LogMessagePublished += (s, e) => { - Debug.WriteLine(e.LogMessage.ToString()); + if (Debugger.IsAttached) + { + Debug.WriteLine(e.LogMessage.ToString()); + } if (e.LogMessage.Level == MqttNetLogLevel.Error) { @@ -59,7 +62,10 @@ namespace MQTTnet.Tests.Mockups ClientLogger.LogMessagePublished += (s, e) => { - Debug.WriteLine(e.LogMessage.ToString()); + if (Debugger.IsAttached) + { + Debug.WriteLine(e.LogMessage.ToString()); + } if (e.LogMessage.Level == MqttNetLogLevel.Error) { diff --git a/Tests/MQTTnet.Core.Tests/Mockups/TestServerWrapper.cs b/Tests/MQTTnet.Core.Tests/Mockups/TestServerWrapper.cs index 4ed83d8..1c651aa 100644 --- a/Tests/MQTTnet.Core.Tests/Mockups/TestServerWrapper.cs +++ b/Tests/MQTTnet.Core.Tests/Mockups/TestServerWrapper.cs @@ -135,6 +135,7 @@ namespace MQTTnet.Tests.Mockups public void Dispose() { + Implementation.Dispose(); } } } \ No newline at end of file diff --git a/Tests/MQTTnet.Core.Tests/Server_Tests.cs b/Tests/MQTTnet.Core.Tests/Server_Tests.cs index 3df7751..7d6a117 100644 --- a/Tests/MQTTnet.Core.Tests/Server_Tests.cs +++ b/Tests/MQTTnet.Core.Tests/Server_Tests.cs @@ -15,6 +15,7 @@ using System.Linq; using System.Text; using System.Threading; using System.Threading.Tasks; +using MQTTnet.Diagnostics; using MQTTnet.Formatter; namespace MQTTnet.Tests