Пример #1
0
        public void GetBytesTest()
        {
            UInt32Attribute target = new Bandwidth()
            {
                Value = 0x87654321,
            };

            byte[] expected = new byte[]
            {
                0xee, 0xee, 0xee, 0xee,
                0x00, 0x10, 0x00, 0x04,
                0x87, 0x65, 0x43, 0x21,
            };

            byte[] actual = new byte[]
            {
                0xee, 0xee, 0xee, 0xee,
                0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00,
            };

            int startIndex = 4;

            target.GetBytes(actual, ref startIndex);

            Assert.AreEqual(12, startIndex);
            Helpers.AreArrayEqual(expected, actual);
        }
Пример #2
0
        public void GetBytesTest()
        {
            UInt32Attribute target = new Bandwidth()
            {
                Value = 0x87654321,
            };

            byte[] expected = new byte[]
            {
                0xee, 0xee, 0xee, 0xee,
                0x00, 0x10, 0x00, 0x04,
                0x87, 0x65, 0x43, 0x21,
            };

            byte[] actual = new byte[]
            {
                0xee, 0xee, 0xee, 0xee,
                0x00, 0x00, 0x00, 0x00,
                0x00, 0x00, 0x00, 0x00,
            };

            int startIndex = 4;
            target.GetBytes(actual, ref startIndex);

            Assert.AreEqual(12, startIndex);
            Helpers.AreArrayEqual(expected, actual);
        }