Ejemplo n.º 1
0
        public void LongConversion()
        {
            // TODO: Test more values.
            byte[] max      = new byte[] { 255, 255, 255, 255, 255, 255, 255, 255 };
            long   expected = BitConverter.ToInt64(max);
            long   actual   = ByteArrayConversion.BytesToLong(max);

            Assert.Equal(expected, actual);

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