Ejemplo n.º 1
0
        public void PasswordWithoutCustomCharsFailsValidation()
        {
            var password = "******".ConvertToSecureString();

            _specialCharactersConstraint = new PasswordIncludesSpecialCharactersConstraint(new[] { '(' });
            Assert.That(_specialCharactersConstraint.Validate(password), Is.False);
        }
Ejemplo n.º 2
0
        public void PasswordUnderMinimumSpecialCharsFailsValidation()
        {
            var password = "******".ConvertToSecureString();

            _specialCharactersConstraint = new PasswordIncludesSpecialCharactersConstraint(2);
            Assert.That(_specialCharactersConstraint.Validate(password), Is.False);
        }
Ejemplo n.º 3
0
        public void PasswordMatchingCustomCharsPassesValidation()
        {
            var password = "******".ConvertToSecureString();

            _specialCharactersConstraint = new PasswordIncludesSpecialCharactersConstraint(new[] { '(' });
            Assert.That(_specialCharactersConstraint.Validate(password), Is.True);
        }
Ejemplo n.º 4
0
        public void PasswordExceedingMinimumSpecialCharsPassesValidation()
        {
            var password = "******".ConvertToSecureString();

            _specialCharactersConstraint = new PasswordIncludesSpecialCharactersConstraint(3);
            Assert.That(_specialCharactersConstraint.Validate(password), Is.True);
        }