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.

34 line
1.0 KiB

  1. using JTNE.Protocol.Enums;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using Xunit;
  6. using JTNE.Protocol.Extensions;
  7. using JTNE.Protocol.MessageBody;
  8. namespace JTNE.Protocol.Test.Extensions
  9. {
  10. public class JTNEPackageExtensionsTest
  11. {
  12. [Fact]
  13. public void Test1()
  14. {
  15. JTNEPackage jTNEPackage= JTNEMsgId.Login.Create("123456789", JTNEAskId.CMD, new JTNE_0x01
  16. {
  17. PDATime = DateTime.Parse("2019-01-22 23:55:56"),
  18. LoginNum = 1,
  19. BatteryLength = 0x04,
  20. SIM = "12345678998765432100",
  21. BatteryNos = new List<string>()
  22. {
  23. "1234",
  24. "4567",
  25. "9870"
  26. }
  27. });
  28. var hex = JTNESerializer.Serialize(jTNEPackage).ToHexString();
  29. Assert.Equal("232301FE313233343536373839000000000000000001002A130116173738000131323334353637383939383736353433323130300304313233343435363739383730FD", hex);
  30. }
  31. }
  32. }