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.

ByteReaderTests.cs 825 B

7 vuotta sitten
7 vuotta sitten
123456789101112131415161718192021222324252627282930
  1. using Microsoft.VisualStudio.TestTools.UnitTesting;
  2. using MQTTnet.Serializer;
  3. namespace MQTTnet.Core.Tests
  4. {
  5. [TestClass]
  6. public class ByteReaderTests
  7. {
  8. [TestMethod]
  9. public void ByteReader_ReadToEnd()
  10. {
  11. var reader = new ByteReader(85);
  12. Assert.IsTrue(reader.Read());
  13. Assert.IsFalse(reader.Read());
  14. Assert.IsTrue(reader.Read());
  15. Assert.IsFalse(reader.Read());
  16. Assert.IsTrue(reader.Read());
  17. Assert.IsFalse(reader.Read());
  18. Assert.IsTrue(reader.Read());
  19. Assert.IsFalse(reader.Read());
  20. }
  21. [TestMethod]
  22. public void ByteReader_ReadPartial()
  23. {
  24. var reader = new ByteReader(15);
  25. Assert.AreEqual(3, reader.Read(2));
  26. }
  27. }
  28. }