Esempio n. 1
0
 private void buttonChangePassword_Click(object sender, EventArgs e)
 {
     try
     {
         ValidateProfile.areNewPassAndRepeatedSame(textBoxNewPassword.Text, textBoxNewPasswordRepeat.Text);
         ValidateProfile.isPasswordCorrect(textBoxNewPassword.Text);
         _imov4EProfileSettingsPresenter.ChangePassword(textBoxOldPassword.Text, textBoxNewPassword.Text, textBoxNewPasswordRepeat.Text);
         textBoxNewPasswordRepeat.Text = null;
         textBoxNewPassword.Text       = null;
         textBoxOldPassword.Text       = null;
         MessageBox.Show("You have successfully changed your password", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Invalid input", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
 public void isPasswordisPasswordCorrectThrowsException()
 {
     Assert.Throws <IncorrectUserDataException>(() => ValidateProfile.isPasswordCorrect("1234"));
 }