Пример #1
0
        public void Test_VerifyHashedPassword_ShouldReturnFailed_FromWhitespacePasswordString()
        {
            var password = "******";
            var hashed   = HashHelpers.CreateSHA256Hash(password);

            var verified = passwordHasher.VerifyHashedPassword(user, hashed, "   ");

            verified.Should().Be(PasswordVerificationResult.Failed);
        }
Пример #2
0
        public void Test_VerifyHashedPassword_ShouldReturnFailed_FromBcryptIntermediateWithVersion_InvalidPassword()
        {
            var password = "******";
            var hashed   = HashHelpers.CreateHashWithVersion(HashHelpers.CreateSHA256Hash(password), HashVersionEnum.Intermediate_SHA256_Bcrypt);

            var verified = passwordHasher.VerifyHashedPassword(user, hashed, "test12345");

            verified.Should().Be(PasswordVerificationResult.Failed);
        }