Ejemplo n.º 1
0
        public static PremiseValidator TextIsWithin <S>(this PremiseValidator context, int lower, int upper = 99999999) where S : IResponseMessage, new()
        {
            return(context.Must <S>(value =>
            {
                var count = (value as string).Count();

                return count >= lower && count <= upper;
            }));
        }
Ejemplo n.º 2
0
 public static PremiseValidator TextIsAlphaNumeric <S>(this PremiseValidator context) where S : IResponseMessage, new()
 {
     return(context.Must <S>(value => value != null ? (value as string).Replace(" ", "").All(char.IsLetterOrDigit) : true));
 }
Ejemplo n.º 3
0
 public static PremiseValidator TextIsNumeric <S>(this PremiseValidator context) where S : IResponseMessage, new()
 {
     return(context.Must <S>(value => value == null || (value as string).All(char.IsNumber)));
 }
Ejemplo n.º 4
0
 public static PremiseValidator TextIsNotEmpty <S>(this PremiseValidator context) where S : IResponseMessage, new()
 {
     return(context.Must <S>(value => !string.IsNullOrWhiteSpace(value as string)));
 }