using Edge.Core.Parser.BinaryParser.Util; using Microsoft.VisualStudio.TestTools.UnitTesting; using System; using System.Collections.Generic; using System.Linq; using System.Text; using Wayne.FDCPOSInterface; namespace FdcServerTest { [TestClass] public class SocketMgrTest { public static bool ValueEquals(IEnumerable array1, IEnumerable array2) { if (array1 == null && array2 == null) { return true; } if ((array1 == null) || (array2 == null)) { return false; } if (array1.Count() != array2.Count()) { return false; } if (array1.Equals(array2)) { return true; } else { for (int Index = 0; Index < array1.Count(); Index++) { if (!Equals(array1.ElementAt(Index), array2.ElementAt(Index))) { return false; } } } return true; } [TestMethod] public void getMsgLength_Test0() { var data = "00 00 01 9f 00 01 4b a9 b2 57 45 a0 dc 84 9b 8b 06 56 79 38 b5 66 3c 3f 78 6d 6c 20 76 65 72 73 69 6f 6e 3d 22 31 2e 30 22 3f 3e 0a 3c 53 65 72 76 69 63 65 52 65 71 75 65 73 74 20 52 65 71 75 65 73 74 54 79 70 65 3d 22 4c 6f 67 4f 6e 22 20 41 70 70 6c 69 63 61 74 69 6f 6e 53 65 6e 64 65 72 3d 22 31 30 31 22 20 57 6f 72 6b 73 74 61 74 69 6f 6e 49 44 3d 22 31 30 31 22 20 52 65 71 75 65 73 74 49 44 3d 22 36 38 36 36 39 35 22 3e 0a 20 20 3c 50 4f 53 64 61 74 61 3e 0a 20 20 20 20 3c 50 4f 53 54 69 6d 65 53 74 61 6d 70 3e 32 30 32 30 2d 30 37 2d 32 39 54 31 37 3a 32 37 3a 30 35 3c 2f 50 4f 53 54 69 6d 65 53 74 61 6d 70 3e 0a 20 20 20 20 3c 52 65 73 70 6f 6e 73 65 50 6f 72 74 3e 34 37 31 31 3c 2f 52 65 73 70 6f 6e 73 65 50 6f 72 74 3e 0a 20 20 20 20 3c 55 6e 73 6f 6c 69 63 69 74 65 64 50 6f 72 74 3e 34 37 31 31 3c 2f 55 6e 73 6f 6c 69 63 69 74 65 64 50 6f 72 74 3e 0a 20 20 20 20 3c 69 6e 74 65 72 66 61 63 65 56 65 72 73 69 6f 6e 3e 30 30 2e 30 37 3c 2f 69 6e 74 65 72 66 61 63 65 56 65 72 73 69 6f 6e 3e 0a 20 20 20 20 3c 70 6f 73 56 61 6c 69 64 61 74 69 6f 6e 3e 63 35 38 32 34 39 62 35 62 65 35 30 39 61 64 35 30 62 31 38 37 32 65 62 35 63 34 31 34 32 33 33 3c 2f 70 6f 73 56 61 6c 69 64 61 74 69 6f 6e 3e 0a 20 20 3c 2f 50 4f 53 64 61 74 61 3e 0a 3c 2f 53 65 72 76 69 63 65 52 65 71 75 65 73 74 3e 0a".ToBytes(); var lengthData = FdcClientTcpHandler.getMsgLength(data); } } }