mirror of
https://github.com/dotnet/MQTTnet.git
synced 2026-10-16 01:03:01 +08:00
23 lines
707 B
C#
23 lines
707 B
C#
using System.IO;
|
|
using System.Threading;
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
using MQTTnet.Exceptions;
|
|
using MQTTnet.Formatter;
|
|
using MQTTnet.Internal;
|
|
|
|
namespace MQTTnet.Core.Tests
|
|
{
|
|
[TestClass]
|
|
public class MqttPacketReaderTests
|
|
{
|
|
[TestMethod]
|
|
[ExpectedException(typeof(MqttCommunicationClosedGracefullyException))]
|
|
public void MqttPacketReader_EmptyStream()
|
|
{
|
|
var fixedHeader = new byte[2];
|
|
var singleByteBuffer = new byte[1];
|
|
MqttPacketReader.ReadFixedHeaderAsync(new TestMqttChannel(new MemoryStream()), fixedHeader, singleByteBuffer, CancellationToken.None).GetAwaiter().GetResult();
|
|
}
|
|
}
|
|
}
|