Exemple #1
0
        private void ShouldConvertBackAndFourth(int byteArrayLength, int longArrayLength)
        {
            byte[] expectedBytes = GetRandomArray(byteArrayLength);

            long[] expectedLongs = hashConverter.ToLongs(expectedBytes, longArrayLength);
            byte[] actualBytes   = hashConverter.ToBytes(expectedLongs, byteArrayLength);

            for (int i = 0; i < byteArrayLength; ++i)
            {
                Assert.AreEqual(expectedBytes[i], actualBytes[i]);
            }

            long[] actualLongs = hashConverter.ToLongs(actualBytes, longArrayLength);
            for (int i = 0; i < longArrayLength; ++i)
            {
                Assert.AreEqual(expectedLongs[i], actualLongs[i]);
            }
        }