public void SignUp_InputValidate_Success_ConintasUnderLine()
        {
            var signUpValidation = new SignUpValidation(_checkString);
            var result           = signUpValidation.InputValidate("test_0000", "password_0000");

            Assert.IsTrue(result.IsSuccessed);
            Assert.IsFalse(result.HasError);
        }
        public void SignUp_InputValidate_Success_Normal()
        {
            var signUpValidation = new SignUpValidation(_checkString);
            var result           = signUpValidation.InputValidate("test", "password");

            Assert.IsTrue(result.IsSuccessed);
            Assert.IsFalse(result.HasError);
        }
        public void SignUp_InputValidate_Failure_UnSpecifiedUserId_AllUnderBar()
        {
            var signUpValidation = new SignUpValidation(_checkString);
            var result           = signUpValidation.InputValidate("_______", "password");

            Assert.IsFalse(result.IsSuccessed);
            Assert.IsTrue(result.HasError);
            Assert.IsTrue(result.UnSpecifiedUserId);
        }
        public void SignUp_InputValidate_Failure_BlankPassword()
        {
            var signUpValidation = new SignUpValidation(_checkString);
            var result           = signUpValidation.InputValidate("test", "");

            Assert.IsFalse(result.IsSuccessed);
            Assert.IsTrue(result.HasError);
            Assert.IsTrue(result.BlankPassword);
        }
        public void SignUp_InputValidate_Failure_UnSpecifiedPassword_AllSymbol()
        {
            var signUpValidation = new SignUpValidation(_checkString);
            var result           = signUpValidation.InputValidate("test", ";;;;;;");

            Assert.IsFalse(result.IsSuccessed);
            Assert.IsTrue(result.HasError);
            Assert.IsTrue(result.UnSpecifiedPassword);
        }
        public void SignUp_InputValidate_Failure_UnSpecifiedPassword_ContainNumberAndKana()
        {
            var signUpValidation = new SignUpValidation(_checkString);
            var result           = signUpValidation.InputValidate("test", "1234あじゃさあ");

            Assert.IsFalse(result.IsSuccessed);
            Assert.IsTrue(result.HasError);
            Assert.IsTrue(result.UnSpecifiedPassword);
        }
示例#7
0
        public SignUpPageViewModel(INavigationService navigationService) : base(navigationService)
        {
            _navigationService = navigationService;
            _restService       = new RestService();
            _checkString       = new CheckString();

            _signUpParam = new SignUpParam();

            _signUpValidation = new SignUpValidation(_checkString);


            SignUpCommand = new DelegateCommand(async() =>
            {
                SignUpLoading = true;

                //新規登録の入力系バリデーション
                SignUpParam = _signUpValidation.InputValidate(SignUpUserId, SignUpPassword);
                if (SignUpParam.HasError == true)
                {
                    SignUpLoading = false; return;
                }

                //新規登録APIのコール
                SignUpParam = await _restService.SignUpUserDataAsync(UserConstants.OpenUserEndPoint, SignUpUserId, SignUpPassword);

                //新規登録にエラーが無く追加が実行されていればLoginPageに遷移する
                if (SignUpParam.HasError == false)
                {
                    SignUpLoading = false;
                    await _navigationService.NavigateAsync("/NavigationPage/LoginPage");
                }
                else
                {
                    SignUpLoading = false;
                }
            });

            GoBackCommand = new DelegateCommand(async() =>
            {
                _ = await _navigationService.GoBackAsync();
            });
        }