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.

MqttPacketReaderTests.cs 540 B

7 years ago
7 years ago
7 years ago
7 years ago
1234567891011121314151617181920
  1. using System.IO;
  2. using System.Threading;
  3. using Microsoft.VisualStudio.TestTools.UnitTesting;
  4. using MQTTnet.Core.Internal;
  5. using MQTTnet.Serializer;
  6. namespace MQTTnet.Core.Tests
  7. {
  8. [TestClass]
  9. public class MqttPacketReaderTests
  10. {
  11. [TestMethod]
  12. public void MqttPacketReader_EmptyStream()
  13. {
  14. var header = MqttPacketReader.ReadFixedHeaderAsync(new TestMqttChannel(new MemoryStream()), CancellationToken.None).GetAwaiter().GetResult();
  15. Assert.AreEqual(-1, header);
  16. }
  17. }
  18. }