mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-25 23:53:07 +08:00
Fix unit tests to allow release builds.
This commit is contained in:
@@ -1,3 +1,5 @@
|
|||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
[assembly:InternalsVisibleTo("MQTTnet.Core.Tests")]
|
[assembly:InternalsVisibleTo("MQTTnet.Core.Tests")]
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ using MQTTnet.Client;
|
|||||||
using MQTTnet.Diagnostics;
|
using MQTTnet.Diagnostics;
|
||||||
using MQTTnet.Exceptions;
|
using MQTTnet.Exceptions;
|
||||||
using MQTTnet.Packets;
|
using MQTTnet.Packets;
|
||||||
using MQTTnet.Implementations;
|
|
||||||
using MQTTnet.Server;
|
|
||||||
|
|
||||||
namespace MQTTnet.Core.Tests
|
namespace MQTTnet.Core.Tests
|
||||||
{
|
{
|
||||||
@@ -41,6 +39,7 @@ namespace MQTTnet.Core.Tests
|
|||||||
Assert.IsInstanceOfType(ex.InnerException, typeof(SocketException));
|
Assert.IsInstanceOfType(ex.InnerException, typeof(SocketException));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if DEBUG
|
||||||
[TestMethod]
|
[TestMethod]
|
||||||
public async Task ClientCleanupOnAuthentificationFails()
|
public async Task ClientCleanupOnAuthentificationFails()
|
||||||
{
|
{
|
||||||
@@ -72,5 +71,6 @@ namespace MQTTnet.Core.Tests
|
|||||||
Assert.IsTrue(client._packetReceiverTask == null || client._packetReceiverTask.IsCompleted, "receive loop not completed");
|
Assert.IsTrue(client._packetReceiverTask == null || client._packetReceiverTask.IsCompleted, "receive loop not completed");
|
||||||
Assert.IsTrue(client._keepAliveMessageSenderTask == null || client._keepAliveMessageSenderTask.IsCompleted, "keepalive loop not completed");
|
Assert.IsTrue(client._keepAliveMessageSenderTask == null || client._keepAliveMessageSenderTask.IsCompleted, "keepalive loop not completed");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user