validateUser() public method

public validateUser ( string centroActual ) : bool
centroActual string
return bool
Example #1
0
 public void validateUserTest()
 {
     string userName = "******"; // TODO: Initialize to an appropriate value
     string password = "******"; // TODO: Initialize to an appropriate value
     Login target = new Login(userName, password); // TODO: Initialize to an appropriate value
     bool expected = true; // TODO: Initialize to an appropriate value
     bool actual;
     actual = target.validateUser("Tegucigalpa");
     Assert.AreEqual(expected, actual);
 }
        public bool login(string user, string password, string centroActual)
        {
            try
            {
                Login l = new Login(user, password);
                bool tmp = l.validateUser(centroActual);

                if (tmp)
                {
                    idEmp = l.getidEmp();
                    return true;
                }
                else
                {
                    return false;
                }
            }
            catch (Exception ex)
            {
                throw new Exception(ex.ToString() + "  --Security.cs / login()");
            }
        }