isPasswordCorrect method and test