示例#1
0
        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);
        }
示例#2
0
        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);
        }