Пример #1
0
 private void buttonChangeLName_Click(object sender, EventArgs e)
 {
     try
     {
         ValidateProfile.isLastNameCorrect(textBoxLNameChanged.Text);
         _imov4EProfileSettingsPresenter.ChangeLastName(textBoxLNameChanged.Text);
         if (_profileScreen.LastName.Equals(textBoxLNameChanged.Text))
         {
             _profileScreen.UpdateLastName();
             textBoxLNameChanged.Text = null;
             MessageBox.Show("You have successfully changed your lastname!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Invalid input", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #2
0
 public void isLastNameCorrectThrowsException()
 {
     Assert.Throws <IncorrectUserDataException>(() => ValidateProfile.isLastNameCorrect("asd1"));
 }