private void btnCreateAccount_Click(object sender, EventArgs e) { this.Hide(); RegisterForm newRegisterForm = new RegisterForm(); newRegisterForm.ShowDialog(); }
public void RegisterPasswordShort() { RegisterForm register = new RegisterForm(); if (register.Password == "12" && register.PasswordConfirm == "12") { Assert.IsTrue(false); } }
public void RegisterWithoutMail() { RegisterForm register = new RegisterForm(); if (register.Mail == "") { Assert.IsTrue(false); } }
public void ConfirmPasswordFalse() { RegisterForm register = new RegisterForm(); if (register.Password != register.PasswordConfirm) { Assert.IsTrue(false); } }
public void ConfirmPassword() { RegisterForm register = new RegisterForm(); if (register.Password == register.PasswordConfirm) { Assert.IsTrue(true); } }
public void RegisterPasswordIsCorrect() { RegisterForm register = new RegisterForm(); if (register.Password == "Pa$$w0rd" && register.PasswordConfirm == "Pa$$w0rd") { Assert.IsTrue(true); } }
private void btnRegister_Click(object sender, EventArgs e) { bool acceptedRequest = true; mail = txtMail.Text; pseudo = txtPseudo.Text; password = txtPassword.Text; passwordComfirm = txtComfirmPassword.Text; if (password.Length < 6) { lblError.Text = "You password is too weak"; acceptedRequest = false; } if (password != passwordComfirm) { lblError.Text = "You passwords does not match"; acceptedRequest = false; } if (password == "") { lblError.Text = "You must enter a password"; acceptedRequest = false; } if (passwordComfirm == "") { lblError.Text = "You must a password AND a comfirm password"; acceptedRequest = false; } if (pseudo == "") { lblError.Text = "You must enter a pseudo"; acceptedRequest = false; } if (!IsValidEmail(mail)) { lblError.Text = "Your mail address is not valid"; acceptedRequest = false; } if (mail == "") { lblError.Text = "You must enter a mail address"; acceptedRequest = false; } if (acceptedRequest == true) { if (Register.CreateUser(mail, pseudo, password)) { this.Hide(); GameForm newGameForm = new GameForm(mail); newGameForm.ShowDialog(); } else { this.Hide(); RegisterForm newRegisterForm = new RegisterForm(); newRegisterForm.ShowDialog(); } } else { lblError.Visible = true; } }