public static void CompareAttribute_can_be_derived_from_and_override_is_valid() { var otherObject = new CompareObject("a"); var currentObject = new CompareObject("b"); var testContext = new ValidationContext(otherObject, null, null); var attribute = new DerivedCompareAttribute("CompareProperty"); AssertEx.DoesNotThrow(() => attribute.Validate(currentObject.CompareProperty, testContext)); }
public void CompareAttributeCanBeDerivedFromAndOverrideIsValid() { object otherObject = new CompareObject("a"); CompareObject currentObject = new CompareObject("b"); ValidationContext testContext = new ValidationContext(otherObject, null, null); DerivedCompareAttribute attr = new DerivedCompareAttribute("CompareProperty"); attr.Validate(currentObject.CompareProperty, testContext); }
public static void Validate_CustomDerivedClass_DoesNotThrow() { var otherObject = new CompareObject("a"); var currentObject = new CompareObject("b"); var testContext = new ValidationContext(otherObject, null, null); var attribute = new DerivedCompareAttribute("CompareProperty"); attribute.Validate(currentObject.CompareProperty, testContext); }