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));
        }
Пример #2
0
        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);
        }
Пример #3
0
        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));
        }
Пример #4
0
        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);
        }
        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);
        }