Ejemplo n.º 1
0
        public void ReadPortDirTest()
        {
            QuickUsb target = new QuickUsb("QUSB-0");

            QuickUsb.Port address = QuickUsb.Port.A;
            byte          data;
            bool          expected = true;
            bool          actual;

            actual = target.ReadPortDir(address, out data);
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 2
0
        public void WritePortTest1()
        {
            QuickUsb target = new QuickUsb("QUSB-0");

            QuickUsb.Port address  = QuickUsb.Port.E;
            byte          data     = 0x7e;
            bool          expected = true;
            bool          actual;

            actual = target.WritePort(address, data);
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 3
0
        public void WritePortTest()
        {
            Random   r      = new Random();
            QuickUsb target = new QuickUsb("QUSB-0");

            QuickUsb.Port address  = QuickUsb.Port.E;
            byte[]        data     = new byte[64];
            ushort        length   = (ushort)data.Length;
            bool          expected = true;
            bool          actual;

            r.NextBytes(data);
            actual = target.WritePort(address, data, length);
            Assert.AreEqual(expected, actual);
        }
Ejemplo n.º 4
0
        public void WritePortDirTest()
        {
            QuickUsb target = new QuickUsb("QUSB-0");

            QuickUsb.Port address = QuickUsb.Port.E;
            byte          data = 0xff, readData;
            bool          expected = true;
            bool          actual;

            actual = target.WritePortDir(address, data);
            Assert.AreEqual(expected, actual);

            actual = target.ReadPortDir(address, out readData);
            Assert.AreEqual(data, readData);
        }
Ejemplo n.º 5
0
        public void ReadPortTest1()
        {
            Random   r      = new Random();
            QuickUsb target = new QuickUsb("QUSB-0");

            QuickUsb.Port address        = QuickUsb.Port.A;
            byte[]        data           = new byte[32];
            ushort        length         = (ushort)data.Length;
            ushort        lengthExpected = (ushort)data.Length;
            bool          expected       = true;
            bool          actual;

            actual = target.ReadPort(address, data, ref length);
            Assert.AreEqual(lengthExpected, length);
            Assert.AreEqual(expected, actual);
        }