Ejemplo n.º 1
0
        public void ULongConversion()
        {
            // TODO: Test more values.
            byte[] max      = new byte[] { 255, 255, 255, 255, 255, 255, 255, 255 };
            ulong  expected = BitConverter.ToUInt64(max);
            ulong  actual   = ByteArrayConversion.BytesToULong(max);

            Assert.Equal(expected, actual);

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