コード例 #1
0
ファイル: mov4eProfileSettings.cs プロジェクト: tswetti/Mov4e
 private void buttonChangeFName_Click(object sender, EventArgs e)
 {
     try
     {
         ValidateProfile.isFirstNameCorrect(textBoxFNameChanged.Text);
         _imov4EProfileSettingsPresenter.ChangeFirstName(textBoxFNameChanged.Text);
         if (_profileScreen.FirstName.Equals(textBoxFNameChanged.Text))
         {
             _profileScreen.UpdateFirstNmae();
             textBoxFNameChanged.Text = null;
             MessageBox.Show("You have successfully changed your firstname!", "Information", MessageBoxButtons.OK, MessageBoxIcon.Information);
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "Invalid input", MessageBoxButtons.OK, MessageBoxIcon.Information);
     }
 }
コード例 #2
0
 public void isFirstNameCorrectThrowsException()
 {
     Assert.Throws <IncorrectUserDataException>(() => ValidateProfile.isFirstNameCorrect("asd1"));
 }