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

33 行
933 B

  1. using JT809.Protocol;
  2. using JT809.Protocol.Extensions;
  3. using JT809.Protocol.MessageBody;
  4. using JT809.Protocol.Exceptions;
  5. using System;
  6. using System.Collections.Generic;
  7. using System.Text;
  8. using Xunit;
  9. namespace JT809.Protocol.Test.JT809MessageBody
  10. {
  11. public class JT809_0x9003Test
  12. {
  13. private JT809Serializer JT809Serializer = new JT809Serializer();
  14. [Fact]
  15. public void Test1()
  16. {
  17. JT809_0x9003 jT809_0X9003 = new JT809_0x9003();
  18. jT809_0X9003.VerifyCode = 45454;
  19. var hex = JT809Serializer.Serialize(jT809_0X9003).ToHexString();
  20. Assert.Equal("0000B18E",hex);
  21. }
  22. [Fact]
  23. public void Test2()
  24. {
  25. var bytes = "00 00 B1 8E".ToHexBytes();
  26. JT809_0x9003 jT809_0X9003 = JT809Serializer.Deserialize<JT809_0x9003>(bytes);
  27. Assert.Equal((uint)45454, jT809_0X9003.VerifyCode);
  28. }
  29. }
  30. }