public void AccountNotExist() { string username = "******"; string password = "******"; LoginBUS login = new LoginBUS(); int status = login.CheckLogin(username, password); Assert.IsFalse(status == 1); }
public void Null_Password() { string username = "******"; string password = ""; LoginBUS login = new LoginBUS(); int status = login.CheckLogin(username, password); Assert.IsFalse(status == 1); }
private void BtnLogin_Click(object sender, EventArgs e) { LoginBUS login = new LoginBUS(); if (string.IsNullOrWhiteSpace(txtUsername.Text) || string.IsNullOrWhiteSpace(txtPassword.Text)) { MessageBox.Show("Hay nhap day du thong tin"); return; } int status = login.CheckLogin(txtUsername.Text, txtPassword.Text); if (status == 1) { fMain fmain = new fMain(login.getType(txtUsername.Text), txtUsername.Text, txtPassword.Text); this.Hide(); fmain.ShowDialog(); } else { MessageBox.Show("Tên tài khoản hoặc mật khẩu không đúng", "Lỗi Đăng Nhập"); } }