Esempio n. 1
0
        public void PresenterSetConfigTest()
        {
            _viewMock.Setup(f => f.SetEmailEditTextTheme(It.IsAny <IEditTextTheme>()));
            _stylesHolderMock.SetupGet(f => f.EmailEditTextTheme).Returns(It.IsAny <IEditTextTheme>());
            _viewMock.Setup(f => f.SetHeaderLabelTheme(It.IsAny <ITextViewTheme>()));
            _stylesHolderMock.SetupGet(f => f.HeaderLabelTheme).Returns(It.IsAny <ITextViewTheme>());
            _viewMock.Setup(f => f.SetRecoveryButtonTheme(It.IsAny <IButtonTheme>()));
            _stylesHolderMock.SetupGet(f => f.RecoveryButtonTheme).Returns(It.IsAny <IButtonTheme>());
            _viewMock.Setup(f => f.SetLogoImageViewTheme(It.IsAny <IImageViewTheme>()));
            _stylesHolderMock.SetupGet(f => f.LogoImageViewTheme).Returns(It.IsAny <IImageViewTheme>());
            _viewMock.Setup(f => f.SetViewTheme(It.IsAny <IImageViewTheme>()));
            _stylesHolderMock.SetupGet(f => f.ViewTheme).Returns(It.IsAny <IImageViewTheme>());
            _viewMock.Setup(f => f.SetBackButtonTheme(It.IsAny <IImageButtonTheme>()));
            _stylesHolderMock.SetupGet(f => f.BackButtonTheme).Returns(It.IsAny <IImageButtonTheme>());
            _viewMock.Setup(f => f.SetEmailLabelTheme(It.IsAny <ITextViewTheme>()));
            _stylesHolderMock.SetupGet(f => f.EmailLabelTheme).Returns(It.IsAny <ITextViewTheme>());

            var presenter = new PresenterForgotPass(_viewMock.Object, _interactorMock.Object, _routerMock.Object,
                                                    DataService.RepositoryController.RepositoryRA.LangRA, _stylesHolderMock.Object);

            presenter.SetConfig();

            _viewMock.Verify(f => f.SetEmailEditTextTheme(It.IsAny <IEditTextTheme>()), Times.AtLeastOnce);
            _viewMock.Verify(f => f.SetHeaderLabelTheme(It.IsAny <ITextViewTheme>()), Times.Once);
            _viewMock.Verify(f => f.SetRecoveryButtonTheme(It.IsAny <IButtonTheme>()), Times.Once);
            _viewMock.Verify(f => f.SetLogoImageViewTheme(It.IsAny <IImageViewTheme>()), Times.Once);
            _viewMock.Verify(f => f.SetViewTheme(It.IsAny <IImageViewTheme>()), Times.Once);
            _viewMock.Verify(f => f.SetBackButtonTheme(It.IsAny <IImageButtonTheme>()));
            _viewMock.Verify(f => f.SetEmailLabelTheme(It.IsAny <ITextViewTheme>()));
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            var interactor = new InteractorForgotPass(new ValidationRA(), new ForgotPassController(ConnectionController.GetInstance(), WebMsgParser.ParseResponseRecoveryPassword));
            var presenter  = new PresenterForgotPass(_forgotPassView, interactor, new RouterForgotPass(this), DataService.RepositoryController.RepositoryRA.LangRA,
                                                     new ForgotPassStylesHolderIOS <GlobalControlsTheme>(iOS_DAL.ThemeParser));

            presenter.SetConfig();
        }
Esempio n. 3
0
        public void EmailInputTest()
        {
            _interactorMock.Setup(f => f.EmailInput(It.IsAny <string>())).Returns(false);
            var presenter = new PresenterForgotPass(_viewMock.Object, _interactorMock.Object, _routerMock.Object,
                                                    DataService.RepositoryController.RepositoryRA.LangRA, _stylesHolderMock.Object);

            presenter.EmailInput(It.IsAny <string>());

            _interactorMock.Verify(f => f.EmailInput(It.IsAny <string>()), Times.Once);
        }
Esempio n. 4
0
        public void ShowAlertEmailRedirectTest()
        {
            _viewMock.Setup(f => f.ShowAlertEmailRedirect(It.IsAny <string>(), It.IsAny <string>()));
            //_interactorMock.Setup(f => f.GetRepository().LangRA.AuthError).Returns(It.IsAny<string>());
            var presenter = new PresenterForgotPass(_viewMock.Object, _interactorMock.Object, _routerMock.Object,
                                                    DataService.RepositoryController.RepositoryRA.LangRA, _stylesHolderMock.Object);

            presenter.ShowAlertEmailRedirect(It.IsAny <EForgotPassStatus>());

            _viewMock.Verify(f => f.ShowAlertEmailRedirect(It.IsAny <string>(), It.IsAny <string>()), Times.Once);
        }
Esempio n. 5
0
        public void HideSpinnerTest()
        {
            _viewMock.Setup(f => f.HideSpinner());

            var presenter = new PresenterForgotPass(_viewMock.Object, _interactorMock.Object, _routerMock.Object,
                                                    DataService.RepositoryController.RepositoryRA.LangRA, _stylesHolderMock.Object);

            presenter.ShowHideSpinner(false);

            _viewMock.Verify(f => f.HideSpinner(), Times.Once);
        }
Esempio n. 6
0
        public void BackButtonClickTest()
        {
            _routerMock.Setup(f => f.ToAuth());

            var presenter = new PresenterForgotPass(_viewMock.Object, _interactorMock.Object, _routerMock.Object,
                                                    DataService.RepositoryController.RepositoryRA.LangRA, _stylesHolderMock.Object);

            presenter.BackButtonClick();

            _routerMock.Verify(f => f.ToAuth(), Times.Once);
        }
Esempio n. 7
0
        public void SetEmailStateSuccessTest()
        {
            var theme = "AuthEditTextSuccessStyle";

            _viewMock.Setup(f => f.SetEmailEditTextTheme(It.IsAny <IEditTextTheme>()));
            _stylesHolderMock.SetupGet(f => f.EmailStateSuccess).Returns(It.IsAny <IEditTextTheme>());
            var presenter = new PresenterForgotPass(_viewMock.Object, _interactorMock.Object, _routerMock.Object,
                                                    DataService.RepositoryController.RepositoryRA.LangRA, _stylesHolderMock.Object);

            presenter.SetEmailState(EState.Success);

            _viewMock.Verify(f => f.SetEmailEditTextTheme(It.IsAny <IEditTextTheme>()));
        }
Esempio n. 8
0
        public void AlertButtonClickTest()
        {
            _routerMock.Setup(f => f.ToAuth());
            _viewMock.Setup(f => f.ShowAlertEmailRedirect(It.IsAny <string>(), It.IsAny <string>()));

            var presenter = new PresenterForgotPass(_viewMock.Object, _interactorMock.Object, _routerMock.Object,
                                                    DataService.RepositoryController.RepositoryRA.LangRA, _stylesHolderMock.Object);

            presenter.ShowAlertEmailRedirect(EForgotPassStatus.RecoverySuccess);
            presenter.AlertButtonClick();

            _routerMock.Verify(f => f.ToAuth(), Times.Once);
        }
Esempio n. 9
0
        public void PresenterSetLocaleTest()
        {
            _viewMock.Setup(f => f.SetButtonLocale(It.IsAny <string>()));
            _viewMock.Setup(f => f.SetHintLocale(It.IsAny <string>()));
            _viewMock.Setup(f => f.SetHeaderLabelLocale(It.IsAny <string>()));

            //_interactorMock.Setup(f => f.GetRepository().LangRA.AuthError).Returns(It.IsAny<string>());
            var presenter = new PresenterForgotPass(_viewMock.Object, _interactorMock.Object, _routerMock.Object,
                                                    DataService.RepositoryController.RepositoryRA.LangRA, _stylesHolderMock.Object);

            presenter.SetLocale();

            _viewMock.Verify(f => f.SetButtonLocale(It.IsAny <string>()));
            _viewMock.Verify(f => f.SetHintLocale(It.IsAny <string>()));
            _viewMock.Verify(f => f.SetHeaderLabelLocale(It.IsAny <string>()));
        }
Esempio n. 10
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            Window.RequestFeature(WindowFeatures.NoTitle);
            SetContentView(Resource.Layout.ForgotPassActivity);

            InitStatusBar();

            SetConfig();

            _view = FindViewById <ForgotPassView>(Resource.Id.forgot_view);

            _interactor = new InteractorForgotPass(new ValidationRA(), new ForgotPassController(ConnectionController.GetInstance(), WebMsgParser.ParseResponseRecoveryPassword));
            var presenter = new PresenterForgotPass(_view, _interactor, new RouterForgotPass(this), DataService.RepositoryController.RepositoryRA.LangRA,
                                                    new ForgotPassStylesHolderDroid <GlobalControlsTheme>(DroidDAL.ThemeParser));

            presenter.SetConfig();
        }