Пример #1
0
        public void CanMatchStrings()
        {
            // arrange
            var stringToHash = "StringToHash";
            var hashGenerator = new HashGenerator();

            // act
            var hash = hashGenerator.GenerateHash(stringToHash);
            var isMatch = hashGenerator.CompareHash(hash, stringToHash);

            // assert
            Assert.AreNotEqual(hash, stringToHash);
            Assert.IsTrue(isMatch);
        }
Пример #2
0
        public void ReturnFalseForMinorChangeOfInput()
        {
            // arrange
            var stringToHash = "StringToHash";
            var stringToMatch = stringToHash + "2";
            var hashGenerator = new HashGenerator();

            // act
            var hash = hashGenerator.GenerateHash(stringToHash);
            var isMatch = hashGenerator.CompareHash(hash, stringToMatch);

            // assert
            Assert.AreNotEqual(hash, stringToHash);
            Assert.IsFalse(isMatch);
        }