public void GetRemovingPropertyRegistrations_SpecialCustomer() { var removingPropertyRegistrations = _specialCustomerPropertyReflector.GetRemovingPropertyRegistrations().ToArray(); Assert.That(removingPropertyRegistrations.Count(), Is.EqualTo(1)); Assert.That(removingPropertyRegistrations[0].ValidatorType, Is.EqualTo(typeof(LengthValidator))); }
private bool HasValidationRulesOnProperty(PropertyInfo property) { var reflector = new ValidationAttributesBasedPropertyRuleReflector(property); return(reflector.GetAddingPropertyValidators().Any() || reflector.GetHardConstraintPropertyValidators().Any() || reflector.GetRemovingPropertyRegistrations().Any()); }
public void GetRemovingPropertyRegistrations_Customer() { var removingPropertyRegistrations = _customerPropertyReflector.GetRemovingPropertyRegistrations().ToArray(); Assert.That(removingPropertyRegistrations.Count(), Is.EqualTo(0)); }