public void EqualToAttributeCanBeDerivedFromAndOverrideIsValid()
        {
            object otherObject = new CompareObject("a");
            CompareObject currentObject = new CompareObject("b");
            ValidationContext testContext = new ValidationContext(otherObject, null, null);

            DerivedEqualToAttribute attr = new DerivedEqualToAttribute("CompareProperty");
            attr.Validate(currentObject.CompareProperty, testContext);
        }
示例#2
0
        public void EqualToAttributeCanBeDerivedFromAndOverrideIsValid()
        {
            object            otherObject   = new CompareObject("a");
            CompareObject     currentObject = new CompareObject("b");
            ValidationContext testContext   = new ValidationContext(otherObject, null, null);

            DerivedEqualToAttribute attr = new DerivedEqualToAttribute("CompareProperty");

            attr.Validate(currentObject.CompareProperty, testContext);
        }