Enum Validation in XML Configuration File

Topics: Developer Forum
Apr 9, 2007 at 3:39 PM
Edited Apr 9, 2007 at 3:43 PM
Afternoon Simon,

Can you see anything wrong with this? AssessmentType is a public property on the Assessment class.

<?xml version="1.0" encoding="utf-8" ?>
<validationMapping xmlns="urn:validationFramework-validationDefinition-1.5">
  <class typeName="Property.Common.Entities.Assessment, Property.Common.Entities">
    <property name="AssessmentType">
      <rule errorMessage="Assessment Type must be specified" typeName="RequiredEnumRuleConfigReader"/>
    </property>
  </class>
</validationMapping>


I'm getting an ArgumentException as follows :-

Error	7	TestCase 'Audatex.Property.Server.UnitTests.PropertyRuleServices_Tests.AssignAssessorRuleSet_CheckAssessmentTypeIsSpecified_AssessmentTypeIsNull'
failed: System.ArgumentException : A property named 'AssessmentType' can not be found containing validators.
Parameter name: propertyName
   at ValidationFramework.PropertyValidationManager.Validate(String propertyName) in C:\dev\src\MainBranch\Architectural\ValidationFramework\Validation\ValidationFramework\PropertyValidationManager.cs:line 250
   at Property.Server.UnitTests.PropertyRuleServices_Tests.AssignAssessorRuleSet_CheckAssessmentTypeIsSpecified_AssessmentTypeIsNull() in C:\dev\src\Audanet\MainBranch\Property\Server\PropertyServer_UnitTests\PropertyRuleServices_Tests.cs:line 216	C:\dev\src\MainBranch\Architectural\ValidationFramework\Validation\ValidationFramework\PropertyValidationManager.cs	250	

Thanks,

- Andrew

Apr 9, 2007 at 5:26 PM
Please ignore me!!!

I hand't marked the XML file as an embedded resource:(

- Andrew