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.

36 lines
1.0 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Xunit;
  5. using JT809.Protocol;
  6. using JT809.Protocol.JT809Extensions;
  7. using JT809.Protocol.JT809MessageBody;
  8. using JT809.Protocol.JT809Exceptions;
  9. using JT809.Protocol.JT809SubMessageBody;
  10. using JT809.Protocol.JT809Enums;
  11. namespace JT809.Protocol.Test.JT809SubMessageBody
  12. {
  13. public class JT809_0x1600_0x1601Test
  14. {
  15. [Fact]
  16. public void Test1()
  17. {
  18. JT809_0x1600_0x1601 jT809_0x1600_0x1601 = new JT809_0x1600_0x1601
  19. {
  20. CarInfo = "smallchi",
  21. };
  22. var hex = JT809Serializer.Serialize(jT809_0x1600_0x1601).ToHexString();
  23. Assert.Equal("736D616C6C636869", hex);
  24. }
  25. [Fact]
  26. public void Test2()
  27. {
  28. var bytes = "736D616C6C636869".ToHexBytes();
  29. JT809_0x1600_0x1601 jT809_0x1600_0x1601 = JT809Serializer.Deserialize<JT809_0x1600_0x1601>(bytes);
  30. Assert.Equal("smallchi", jT809_0x1600_0x1601.CarInfo);
  31. }
  32. }
  33. }