public static void OverriddenAllocatingGetHashAndReset_CorrectSize()
        {
            var hash = new FlexibleAlgorithmOverride(12);

            byte[] ret = hash.GetHashAndReset();
            Assert.Equal(hash.HashLengthInBytes, ret.Length);
            Assert.Equal(0, hash.GetCurrentHashCoreCallCount);
            Assert.Equal(1, hash.GetHashAndResetCoreCallCount);
        }
        public static void OverriddenGetHashAndReset_TooSmall()
        {
            byte[] buf  = new byte[7];
            var    hash = new FlexibleAlgorithmOverride(buf.Length + 1);

            Assert.True(hash.IsReset);
            hash.Append(buf);
            Assert.False(hash.IsReset);

            for (int i = 0; i <= buf.Length; i++)
            {
                AssertExtensions.Throws <ArgumentException>(
                    "destination",
                    () => hash.GetHashAndReset(buf.AsSpan(i)));
            }

            Assert.Equal(0, hash.GetCurrentHashCoreCallCount);
            Assert.Equal(0, hash.GetHashAndResetCoreCallCount);
            Assert.False(hash.IsReset);
        }