public void IsSatisfiedBy(string input, bool expected) { var specification = new AlphanumericSpecification(); bool actual = specification.IsSatisfiedBy(input); Assert.Equal(expected, actual); }
protected override bool IsValid(PropertyValidatorContext context) { var stringToValidate = context.PropertyValue as string; if (string.IsNullOrEmpty(stringToValidate)) { return(true); } var specification = new AlphanumericSpecification(); return(specification.IsSatisfiedBy(stringToValidate)); }