示例#1
0
文件: Isbn.cs 项目: linven/TypeLess
 private static IStringAssertion IsValidISBN10(this IStringAssertionU source)
 {
     source.Extend(x =>
     {
         return(AssertResult.New(ValidIsbn10(x), Resources.IsValidISBN));
     });
     return((IStringAssertion)source);
 }
示例#2
0
 public static IStringAssertion IsValidPersonalNumber(this IStringAssertionU source)
 {
     source.Extend(x =>
     {
         return(AssertResult.New(Luhn.IsValid(x.ToIntArray()), Resources.IsValidPersonalNumber));
     });
     return((IStringAssertion)source);
 }
示例#3
0
 public static IStringAssertion IsValidSocialSecurityNumber(this IStringAssertionU source)
 {
     source.Extend(x =>
     {
         var isValid = Regex.IsMatch(x, _regex);
         return(AssertResult.New(isValid, Resources.IsValidSocialSecurityNumber));
     });
     return((IStringAssertion)source);
 }
示例#4
0
        public static IStringAssertion IsNotValidImoNr(this IStringAssertionU source)
        {
            source.Extend(x =>
            {
                return(AssertResult.New(!ImoValidator.IsValid(x), Resources.IsNotValidImoNr));
            });

            return((IStringAssertion)source);
        }
示例#5
0
 public static IStringAssertion IsValidZipCode(this IStringAssertionU source)
 {
     source.Extend(x =>
     {
         var isValid = Regex.IsMatch(x, _regex);
         return(AssertResult.New(isValid, Resources.IsValidZipCode));
     });
     return((IStringAssertion)source);
 }
示例#6
0
        public static IStringAssertion IsNotValidPhoneNumber(this IStringAssertionU source)
        {
            source.Extend(x =>
            {
                var isValid = Regex.IsMatch(x, _regex);

                return(AssertResult.New(!isValid, Resources.IsNotValidPhoneNumber));
            });
            return((IStringAssertion)source);
        }