Exemple #1
0
        public void TryHackMessage_LargeHashNumberWithLargeRange()
        {
            // arrange
            int clientId = 1;
            int secret   = 4965634;

            MD5    md5Hash        = MD5.Create();
            string correctMd5Hash = Program.GetMd5Hash(md5Hash, secret.ToString());

            HFMessage message = new HFMessage()
            {
                Start        = 1,
                End          = 10000000,
                HashedSecret = correctMd5Hash
            };

            string actual, expected = $"[{clientId}] found secret: {secret} with hash {correctMd5Hash}";

            // act
            actual = Program.TryHackMessage(message, md5Hash, clientId);

            // assert
            Assert.AreEqual(expected, actual);
        }