Ejemplo n.º 1
0
        public async Task LogInCredentialsAsync(string email, string password)
        {
            bool error = false;

            if (string.IsNullOrEmpty(email))
            {
                _logInView.SetEmailError();
                error = true;
            }
            if (string.IsNullOrEmpty(password))
            {
                _logInView.SetPasswordError();
                error = true;
            }

            if (!error)
            {
                _logInView.ShowProgressDialog();
                var validation = await Task.Factory.StartNew(() => _logInModel.ValidateLogIn(email, password));

                //Validate email "syntax" aswell??
                if (validation)
                {
                    _logInView.HideLogInErrorMsg();
                    _logInView.HideProgressDialog();
                    _logInView.NavigateToHome();
                }
                else
                {
                    _logInView.ShowLogInErrorMsg();
                    _logInView.HideProgressDialog();
                }
            }
        }
Ejemplo n.º 2
0
 public void LogInCredentialsAsync_CorrectEmailAndPasswordEntered_HidesLogInError()
 {
     _fakeModel.ValidateLogIn("test", "1234").Returns(true);
     _uut.LogInCredentialsAsync("test", "1234").Wait();
     _fakeView.Received().HideLogInErrorMsg();
 }