您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

MqttPacketReaderTests.cs 540 B

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. }