You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

MqttPacketReader_Tests.cs 659 B

7 years ago
7 years ago
6 years ago
7 years ago
7 years ago
5 years ago
7 years ago
7 years ago
7 years ago
1234567891011121314151617181920212223
  1. using System.IO;
  2. using System.Threading;
  3. using System.Threading.Tasks;
  4. using Microsoft.VisualStudio.TestTools.UnitTesting;
  5. using MQTTnet.Formatter;
  6. using MQTTnet.Internal;
  7. namespace MQTTnet.Tests
  8. {
  9. [TestClass]
  10. public class MqttPacketReader_Tests
  11. {
  12. [TestMethod]
  13. public async Task MqttPacketReader_EmptyStream()
  14. {
  15. var fixedHeader = new byte[2];
  16. var reader = new MqttPacketReader(new TestMqttChannel(new MemoryStream()));
  17. var readResult = await reader.ReadFixedHeaderAsync(fixedHeader, CancellationToken.None);
  18. Assert.IsTrue(readResult.ConnectionClosed);
  19. }
  20. }
  21. }