public void login_test()
 {
     {
         bool   ActualResult = login.checkUser();
         string ExpectResult = "Hari";
         Assert.AreEqual(ActualResult, ExpectResult);
     }
 }
        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);
        }
Пример #3
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");
            }
        }