public void ChangePasswordRequestIsMade_EverythingValid_ValidationShouldSucceed() { var validatorService = new PasswordValidator(CreateDefaultValidationRules()); var request = new ChangePasswordRequestModel { Password = "******" }; var validator = new ChangePasswordRequestValidator(validatorService); var result = validator.Validate(request); Assert.True(result.IsValid); }
public void ChangePasswordRequestIsMade_InvalidPassword_ValidationShouldFail(string inputPassword) { var validatorService = new PasswordValidator(CreateDefaultValidationRules()); var request = new ChangePasswordRequestModel() { Password = inputPassword }; var validator = new ChangePasswordRequestValidator(validatorService); var result = validator.Validate(request); Assert.False(result.IsValid); }