Пример #1
0
        public void Message_g_ReadTest()
        {
            //Arrange
            byte[]    bytearray = new byte[] { 0, 250, 2, 9, 0, 10 };
            Message_g msg       = new Message_g(250, 2, 9, 10);
            //act
            MsgBuffer msgBuffer = msg.ToAciMsgBuffer();

            int i = 0;

            foreach (var bytes in msgBuffer.Buffer)
            {
                Assert.AreEqual(bytes, bytearray[i]);
                i++;
            }
        }
Пример #2
0
        public void Message_g_WriteTest()
        {
            //Arrange
            byte[]     bytearray = new byte[] { 0, 250, 2, 9, 0, 10, 0, 1, 0, 2, 0, 3, 0, 4, 0, 5, 0, 6, 0, 7, 0, 8, 0, 9 };
            List <int> parlist   = new List <int>(new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 });
            Message_g  msg       = new Message_g(250, 2, 9, 10, parlist);
            //act
            MsgBuffer msgBuffer = msg.ToAciMsgBuffer();

            int i = 0;

            foreach (var bytes in msgBuffer.Buffer)
            {
                Assert.AreEqual(bytes, bytearray[i]);
                i++;
            }
        }