public void Register_WhenEmailAndPasswordAreValid_ThenCallsRegisterService() { var email = "*****@*****.**"; var password = _auto.Create <string>(); _subject.Email = email; _subject.Password = password; _emailValidator.IsValid(email).Returns(true); _passwordValidator.IsValid(password).Returns(true); _subject.Register(); _registerService.Received(1).RegisterUser(email, password); }
public async void AddUser() { string message = _passwordValidator.IsValid(Login, Password, Confirm, Repository.GetItems <User>()); if (message == "Valid") { var navParam = new NavigationParameters(); navParam.Add("Login", Login); Repository.SaveItem(new User(Login, Password)); await NavigationService.NavigateAsync($"/{nameof(SignInView)}", navParam); } else { string error = _translator.GetTranslate(message); _userDialogs.Alert(error, "Ok"); } }
public void Should_Return_False_When_Trying_To_Submit_Less_Then_Nine_Characters(string password) { //Arrange EntityPassword passwordRequest = new EntityPassword(); passwordRequest.Password = password; //Act bool result = _passwordValidator.IsValid(passwordRequest); //assert result.Should().BeFalse(); }
protected ValidateUser ValidatePassword() { _passwordValidator.Validate(User); IsValid = _passwordValidator.IsValid(); return(this); }
void SomeMethod(PasswordChangeModel passwordChangeModel) { _passwordValidator.IsValid(passwordChangeModel); }
/// <summary> /// Executa as regras de validação de Password conforme dominio /// </summary> /// <param name="passwordValidation"></param> /// <returns></returns> public bool IsValid(EntityPassword passwordValidation) { return(_passwordValidator.IsValid(passwordValidation)); }