コード例 #1
0
        public void TestPackageOk1()
        {
            var frame = new byte[]
            { 0x05, 0x03, 0x09, 0x07, 0x03, 0x55, 0x00, 0x50, 0x80, 0x00, 0x62, 0xff, 0xa3, 0xff, 0xaa };
            var ebus = new EBusMoq(null);

            var recv = ebus.Write(frame);

            Assert.Equal(frame, recv);
        }
コード例 #2
0
        public void TestPackageNotOk1()
        {
            var frame = new byte[]
            { 0x05, 0x03, 0x09, 0x07, 0x03, 0x55, 0x00, 0x50, 0x80, 0x00, 0x62, 0xff, 0xa3, 0xff, 0xbb };

            var wrapFrame = new byte[frame.Length + 10];

            Array.Fill(wrapFrame, (byte)0xBB, 0, wrapFrame.Length);
            Array.Copy(frame, 0, wrapFrame, 0, frame.Length);

            var ebus = new EBusMoq(null);
            var recv = ebus.Write(wrapFrame);

            Assert.Null(recv);
        }