public void Verify_ValidPasswordAndHash_ReturnsTrue(PasswordHashPair passwordHashPair) { // Arrange string correctPassword = passwordHashPair.Password; string expectedHash = passwordHashPair.Hash; // Act bool result = PasswordHelper.Verify(correctPassword, expectedHash); // Assert Assert.IsTrue(result); }
public void Verify_InvalidPasswordAndHash_ReturnsFalse(PasswordHashPair passwordHashPair) { // Arrange string wrongPassword = passwordHashPair.Password; string expectedHash = passwordHashPair.Hash; // Act bool result = PasswordHelper.Verify(wrongPassword, expectedHash); // Assert Assert.IsFalse(result); }
public void Hash_HashWithoutSalt_CheckIfReturnsValidSha256Hash(PasswordHashPair passwordHashPair) { // Arrange string givenPassword = passwordHashPair.Password; string expectedHash = passwordHashPair.Hash; // Act string actualHash = PasswordHelper.Hash(givenPassword); // Assert Assert.AreEqual(expectedHash, actualHash); }