private void DoValidation(ApplicationConfigurationFileNode fileNode, int expectedErrors)
 {
     PropertyInfo fileNameInfo = typeof(ApplicationConfigurationFileNode).GetProperty("FileName");
     ApplicationConfigurationFileValidationAttribute attr = new ApplicationConfigurationFileValidationAttribute();
     List<ValidationError> errors = new List<ValidationError>();
     attr.Validate(fileNode, fileNameInfo, errors, ServiceProvider);
     Assert.AreEqual(expectedErrors, errors.Count);
 }
Example #2
0
        private void DoValidation(ApplicationConfigurationFileNode fileNode, int expectedErrors)
        {
            PropertyInfo fileNameInfo = typeof(ApplicationConfigurationFileNode).GetProperty("FileName");
            ApplicationConfigurationFileValidationAttribute attr = new ApplicationConfigurationFileValidationAttribute();
            List <ValidationError> errors = new List <ValidationError>();

            attr.Validate(fileNode, fileNameInfo, errors, ServiceProvider);
            Assert.AreEqual(expectedErrors, errors.Count);
        }
Example #3
0
        public void ValidatingInvalidPathCharactersFails()
        {
            ApplicationConfigurationFileNode appConfigurationFileNode = new ApplicationConfigurationFileNode("def|abc");

            DoValidation(appConfigurationFileNode, 1);
        }
 public void ValidatingInvalidPathCharactersFails()
 {
     ApplicationConfigurationFileNode appConfigurationFileNode = new ApplicationConfigurationFileNode("def|abc");
     DoValidation(appConfigurationFileNode, 1);
 }