public void GetNumRS232Test() { QuickUsb target = new QuickUsb("QUSB-0"); byte portNum = 0; ushort length = 0; ushort lengthExpected = 0; bool expected = true; bool actual; actual = target.GetNumRS232(portNum, out length); Assert.AreEqual(lengthExpected, length); Assert.AreEqual(expected, actual); }
public void ReadRS232Test() { QuickUsb target = new QuickUsb("QUSB-0"); byte portNum = 0; byte[] data = new byte[64]; ushort length = (ushort)data.Length; ushort lengthExpected = 0; bool expected = true; bool actual; actual = target.GetNumRS232(portNum, out lengthExpected); Assert.AreEqual(expected, actual); if (lengthExpected > 0) { actual = target.ReadRS232(portNum, data, ref length); Assert.AreEqual(lengthExpected, length); Assert.AreEqual(expected, actual); } }