Пример #1
0
        public void UInt16Test()
        {
            UInt16 expected = 0x1234;

            byte[] bytes  = Bigendian.GetBigendianBytes(expected);
            UInt16 actual = Bigendian.BigendianToUInt16(bytes, 0);

            Assert.AreEqual(expected, actual);
        }
Пример #2
0
        public void BigendianToUInt16Test()
        {
            byte[] bytes      = new byte[] { 0x22, 0x11 };
            int    startIndex = 0;
            UInt16 actual     = Bigendian.BigendianToUInt16(bytes, ref startIndex);

            Assert.AreEqual(2, startIndex);
            Assert.AreEqual(0x2211, actual);
        }