Ejemplo 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);
     }
 }
Ejemplo n.º 2
0
 public void areNewPassAndRepeatedSameThrowsException()
 {
     Assert.Throws <IncorrectUserDataException>(() => ValidateProfile.areNewPassAndRepeatedSame("131", "3232231"));
 }