Пример #1
0
 private void buttonChangeEmail_Click(object sender, EventArgs e)
 {
     try
     {
         ValidateProfile.isEMailCorrect(textBoxEmailChanged.Text);
         _imov4EProfileSettingsPresenter.ChangeEmail(textBoxEmailChanged.Text);
         if (_profileScreen.Email.Equals(textBoxEmailChanged.Text))
         {
             _profileScreen.UpdateEmail();
             textBoxEmailChanged.Text = null;
             MessageBox.Show("You have successfully changed your E-mail!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Invalid input", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
Пример #2
0
 public void isEMailCorrectMailIsCorrect()
 {
     Assert.DoesNotThrow(() => ValidateProfile.isEMailCorrect("*****@*****.**"));
 }
Пример #3
0
 public void isEMailCorrectThrowsException()
 {
     Assert.Throws <IncorrectUserDataException>(() => ValidateProfile.isEMailCorrect("1234"));
 }