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 708 B

пре 7 година
пре 6 година
пре 7 година
пре 7 година
пре 7 година
12345678910111213141516171819202122
  1. using System.IO;
  2. using System.Threading;
  3. using Microsoft.VisualStudio.TestTools.UnitTesting;
  4. using MQTTnet.Exceptions;
  5. using MQTTnet.Internal;
  6. using MQTTnet.Serializer;
  7. namespace MQTTnet.Core.Tests
  8. {
  9. [TestClass]
  10. public class MqttPacketReaderTests
  11. {
  12. [TestMethod]
  13. [ExpectedException(typeof(MqttCommunicationClosedGracefullyException))]
  14. public void MqttPacketReader_EmptyStream()
  15. {
  16. var fixedHeader = new byte[2];
  17. var singleByteBuffer = new byte[1];
  18. MqttPacketReader.ReadFixedHeaderAsync(new TestMqttChannel(new MemoryStream()), fixedHeader, singleByteBuffer, CancellationToken.None).GetAwaiter().GetResult();
  19. }
  20. }
  21. }