Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

MqttPacketWriterTests.cs 700 B

pirms 5 gadiem
12345678910111213141516171819202122232425
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using MQTTnet.Formatter;
  3. namespace MQTTnet.Tests
  4. {
  5. [TestClass]
  6. public class MqttPacketWriterTests
  7. {
  8. [TestMethod]
  9. public void WritePacket()
  10. {
  11. var writer = new MqttPacketWriter();
  12. Assert.AreEqual(0, writer.Length);
  13. writer.WriteWithLengthPrefix("1234567890");
  14. Assert.AreEqual(10 + 2, writer.Length);
  15. writer.WriteWithLengthPrefix(new byte[300]);
  16. Assert.AreEqual(300 + 2 + 12, writer.Length);
  17. writer.WriteWithLengthPrefix(new byte[5000]);
  18. Assert.AreEqual(5000 + 2 + 300 + 2 + 12, writer.Length);
  19. }
  20. }
  21. }