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.

37 line
1.1 KiB

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Xunit;
  5. using JT809.Protocol;
  6. using JT809.Protocol.Extensions;
  7. using JT809.Protocol.MessageBody;
  8. using JT809.Protocol.Exceptions;
  9. using JT809.Protocol.SubMessageBody;
  10. using JT809.Protocol.Enums;
  11. namespace JT809.Protocol.Test.JT809SubMessageBody
  12. {
  13. public class JT809_0x1500_0x1501Test
  14. {
  15. private JT809Serializer JT809Serializer = new JT809Serializer();
  16. [Fact]
  17. public void Test1()
  18. {
  19. JT809_0x1500_0x1501 jT809_0X1500_0X1501 = new JT809_0x1500_0x1501
  20. {
  21. Result= JT809_0x1501_Result.监听成功
  22. };
  23. var hex = JT809Serializer.Serialize(jT809_0X1500_0X1501).ToHexString();
  24. Assert.Equal("00",hex);
  25. }
  26. [Fact]
  27. public void Test2()
  28. {
  29. var bytes = "00".ToHexBytes();
  30. JT809_0x1500_0x1501 jT809_0X1500_0X1501 = JT809Serializer.Deserialize<JT809_0x1500_0x1501>(bytes);
  31. Assert.Equal(JT809_0x1501_Result.监听成功, jT809_0X1500_0X1501.Result);
  32. }
  33. }
  34. }