public void WhenNotEmail_ReturnsSuccess()
        {
            var validator = new NotBePersonalDataNewPasswordValidator();
            var context   = new NewPasswordValidationContext()
            {
                Password = "******",
                Email    = "*****@*****.**"
            };

            var result = validator.Validate(context);

            result.Should().BeNull();
        }
        public void WhenNotUsername_ReturnsSuccess()
        {
            var validator = new NotBePersonalDataNewPasswordValidator();
            var context   = new NewPasswordValidationContext()
            {
                Password = "******",
                Username = "******"
            };

            var result = validator.Validate(context);

            result.Should().BeNull();
        }
        public void WhenUsername_ReturnsError()
        {
            var validator = new NotBePersonalDataNewPasswordValidator();
            var context   = new NewPasswordValidationContext()
            {
                Password = "******",
                Username = "******"
            };

            var result = validator.Validate(context);

            result.Should().NotBeNull();
            result.ErrorCode.Should().Be(PasswordPolicyValidationErrors.NotPersonalData.Username.ErrorCode);
        }
        public void WhenEmail_ReturnsError()
        {
            var validator = new NotBePersonalDataNewPasswordValidator();
            var context   = new NewPasswordValidationContext()
            {
                Password = "******",
                Email    = "*****@*****.**"
            };

            var result = validator.Validate(context);

            result.Should().NotBeNull();
            result.ErrorCode.Should().Be(PasswordPolicyValidationErrors.NotPersonalData.Email.ErrorCode);
        }