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