public void logintesting()
        {
            string username = "******";
            string password = "******";

            WindowsFormsApp3.login_class checkLogin = new WindowsFormsApp3.login_class();


            checkLogin._username = username;
            checkLogin._password = password;

            bool actualResult   = checkLogin.checkUser();
            bool expectedResult = true;

            Assert.AreEqual(actualResult, expectedResult);
        }
예제 #2
0
        private void button1_Click(object sender, EventArgs e)
        {
            login_class LoginBLL = new login_class();

            LoginBLL._username = txtusername.Text.Trim();
            LoginBLL._password = txtpassword.Text.Trim();

            bool isValidUser = LoginBLL.checkUser();

            if (isValidUser)
            {
                this.Hide();
                frm_dashboard obj = new frm_dashboard(txtusername.Text);
                obj.ShowDialog();
                this.Close();
            }
            else
            {
                MessageBox.Show("Username or password is incorrect");
            }
        }