Пример #1
0
        public void SolveTest_Q2HashTableAttack()
        {
            Assert.Inconclusive();
            Processor p = new Q2HashTableAttack("TD2");

            TestTools.RunLocalTest("E2b", p.Process, p.TestDataName, HashVerifier, VerifyResultWithoutOrder: p.VerifyResultWithoutOrder,
                                   excludedTestCases: p.ExcludedTestCases);
        }
Пример #2
0
        public static void HashVerifier(string inputFileName, string testResult)
        {
            long bucketCount = long.Parse(File.ReadAllText(inputFileName));

            string[] result = testResult.Split(TestTools.IgnoreChars, StringSplitOptions.RemoveEmptyEntries);
            Assert.IsTrue(result.Length == bucketCount * 0.9);
            long bucketNumber = Q2HashTableAttack.GetBucketNumber(result[0], bucketCount);

            foreach (string str in result)
            {
                Assert.AreEqual(bucketNumber, Q2HashTableAttack.GetBucketNumber(str, bucketCount));
            }
        }