Пример #1
0
        public void Should_return_true_when_comparing_equal_hash_values()
        {
            var value            = this.MockString(8);
            var expectedPassword = new SecurityPassword(value);
            var salt             = expectedPassword.Salt;
            var comparedPassword = new SecurityPassword(value, salt);

            Assert.IsTrue(SecurityPassword.CompareHashValues(expectedPassword.HashValue, comparedPassword.HashValue));
        }
Пример #2
0
        public void Should_return_false_when_comparing_different_hash_values()
        {
            var expectedValue    = this.MockString(8);
            var comparedValue    = this.MockString(9);
            var expectedPassword = new SecurityPassword(expectedValue);
            var comparedPassword = new SecurityPassword(comparedValue);

            Assert.IsFalse(SecurityPassword.CompareHashValues(expectedPassword.HashValue, comparedPassword.HashValue));
        }