Ejemplo n.º 1
0
        public void UIntConversion()
        {
            // TODO: Test more values.
            byte[] max      = new byte[] { 255, 255, 255, 255 };
            uint   expected = BitConverter.ToUInt32(max);
            uint   actual   = ByteArrayConversion.BytesToUInt(max);

            Assert.Equal(expected, actual);

            byte[] expectedBytes = BitConverter.GetBytes(uint.MaxValue);
            byte[] actualBytes   = ByteArrayConversion.UIntToBytes(uint.MaxValue);
            Assert.Equal(expectedBytes, actualBytes);
        }