public void _0007_MakeActionRequest() { byte[] AtmUnitTest_Request_ActionStart = { 0x01, 0x21, 0x00, 0x00, 0x10, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00 }; byte[] buffer = new byte[64]; int bytes = CanServices.MakeServiceRequest(buffer, 0x21, 0x17); byte[] result = new byte[bytes]; Buffer.BlockCopy(buffer, 0, result, 0, bytes); Assert.IsTrue(AtmUnitTest_Request_ActionStart.SequenceEqual(result)); }
public void _0008_ParseActionResponse() { byte[] AtmUnitTest_Response_ActionStart = { 0x01, 0x21, 0x00, 0x00, 0x00, 0x00, 0x17, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0xFF, 0xFE, 0x00, 0x00, }; UInt16 status; byte frameCnt; CanServices.ParseActionResponse(AtmUnitTest_Response_ActionStart, out frameCnt, out status); Assert.AreEqual(0x21, frameCnt); Assert.AreEqual(0x0000, status); }