public void WhenLessThanMaxLength_ReturnsSuccess(string password)
        {
            var validator = new MaxLengthNewPasswordValidator();

            validator.Configure(8);

            var context = new NewPasswordValidationContext()
            {
                Password = password
            };

            var result = validator.Validate(context);

            result.Should().BeNull();
        }
        public void WhenMoreThanMaxLength_ReturnsError()
        {
            var validator = new MaxLengthNewPasswordValidator();

            validator.Configure(8);

            var context = new NewPasswordValidationContext()
            {
                Password = "******"
            };

            var result = validator.Validate(context);

            result.Should().NotBeNull();
            result.ErrorCode.Should().Be(PasswordPolicyValidationErrors.MaxLengthExceeded.ErrorCode);
        }