コード例 #1
0
        public void MessageChunks()
        {
            var bytes    = new byte[] { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
            var command  = new SendMessageCommand("AQIDBAU=", 255, 3, bytes);
            var packages = command.GetPackets().ToArray().Cast <byte[]>().ToList();

            if (packages.Any(x => x.Length > 20))
            {
                Assert.Fail();
            }
        }
コード例 #2
0
        public void SendMessageCommand()
        {
            var    bytes   = new byte[] { 1, 2, 3, 4, 5 };
            var    command = new SendMessageCommand("AQIDBAU=", 255, 3, bytes);
            var    package = command.GetPackets()[0] as byte[];
            string hex     = package.ToHexString();

            if (hex != "0010010102030405FF000301020304050CC60000")
            {
                Assert.Fail();
            }
        }