Example #1
0
 public void CharValidation()
 {
     Assert.True(MaskedTextProvider.IsValidInputChar('1'));
     Assert.True(MaskedTextProvider.IsValidMaskChar('M'));
     Assert.True(MaskedTextProvider.IsValidPasswordChar('\0'));
     Assert.False(MaskedTextProvider.IsValidInputChar('\n'));
 }
Example #2
0
        private static bool IsMaskValid(object value)
        {
            string mask = (string)value;

            if (string.IsNullOrEmpty(mask))
            {
                return(true);
            }

            foreach (char ch in mask)
            {
                if (!MaskedTextProvider.IsValidMaskChar(ch))
                {
                    return(false);
                }
            }

            return(true);
        }