public void RequestForValidatorBasedOnAttributesWithRulesetReturnsAppropriateValidator()
        {
            Validator validator
                = PropertyValidationFactory.GetPropertyValidatorFromAttributes(typeof(TestObjectWithFailingAttributesOnProperties),
                                                                               typeof(TestObjectWithFailingAttributesOnProperties).GetProperty("FailingProperty1"), "RuleA",
                                                                               new MemberAccessValidatorBuilderFactory());

            TestObjectWithFailingAttributesOnProperties objectToTest = new TestObjectWithFailingAttributesOnProperties();
            objectToTest.FailingProperty1 = "property value";
            ValidationResults validationResults = validator.Validate(objectToTest);

            IList<ValidationResult> resultsList = ValidationTestHelper.GetResultsList(validationResults);
            Assert.AreEqual(1, resultsList.Count);
            Assert.AreEqual("message1-RuleA", resultsList[0].Message);
        }
        public void RequestForValidatorBasedOnAttributesAndConfigurationWithRulesetThroughStaticFacadeReturnsAppropriateValidator()
        {
            Validator validator
                = PropertyValidationFactory.GetPropertyValidator(typeof(TestObjectWithFailingAttributesOnProperties),
                                                                 typeof(TestObjectWithFailingAttributesOnProperties).GetProperty("FailingProperty1"),
                                                                 "RuleA",
                                                                 ValidationSpecificationSource.Both,
                                                                 new MemberAccessValidatorBuilderFactory());

            TestObjectWithFailingAttributesOnProperties objectToTest = new TestObjectWithFailingAttributesOnProperties();
            objectToTest.FailingProperty1 = "property value";
            ValidationResults validationResults = validator.Validate(objectToTest);

            IDictionary<string, ValidationResult> resultsMapping = ValidationTestHelper.GetResultsMapping(validationResults);
            Assert.AreEqual(3, resultsMapping.Count);
            Assert.IsTrue(resultsMapping.ContainsKey("message-from-config1-RuleA"));
            Assert.IsTrue(resultsMapping.ContainsKey("message-from-config2-RuleA"));
            Assert.IsTrue(resultsMapping.ContainsKey("message1-RuleA"));
        }