mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-21 12:16:02 +08:00
Refactor code.
This commit is contained in:
+3
-3
@@ -10,16 +10,16 @@ using MQTTnet.Channel;
|
||||
|
||||
namespace MQTTnet.Tests.Mockups
|
||||
{
|
||||
public sealed class TestMqttChannel : IMqttChannel
|
||||
public sealed class MemoryMqttChannel : IMqttChannel
|
||||
{
|
||||
readonly MemoryStream _stream;
|
||||
|
||||
public TestMqttChannel(MemoryStream stream)
|
||||
public MemoryMqttChannel(MemoryStream stream)
|
||||
{
|
||||
_stream = stream;
|
||||
}
|
||||
|
||||
public TestMqttChannel(byte[] buffer)
|
||||
public MemoryMqttChannel(byte[] buffer)
|
||||
{
|
||||
_stream = new MemoryStream(buffer);
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
// Licensed to the .NET Foundation under one or more agreements.
|
||||
// The .NET Foundation licenses this file to you under the MIT license.
|
||||
// See the LICENSE file in the project root for more information.
|
||||
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using MQTTnet.Packets;
|
||||
|
||||
namespace MQTTnet.Tests.Mockups
|
||||
{
|
||||
public sealed class MqttPacketAsserts
|
||||
{
|
||||
public void AssertIsConnectPacket(MqttPacket packet)
|
||||
{
|
||||
Assert.AreEqual(packet.GetType(), typeof(MqttConnectPacket));
|
||||
}
|
||||
|
||||
public void AssertIsConnAckPacket(MqttPacket packet)
|
||||
{
|
||||
Assert.AreEqual(packet.GetType(), typeof(MqttConnAckPacket));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user