public void InvalidTypeProducesAnError()
        {
            TypeValidationAttribute attribute = new TypeValidationAttribute();
            typeNode.TypeName = "MyTest";
            List<ValidationError> errors = new List<ValidationError>();
			attribute.Validate(typeNode, valueInfo1, errors, ServiceProvider);
            Assert.AreEqual(1, errors.Count);
        }
        public void ValidTypeProducesNoErrors()
        {
            TypeValidationAttribute attribute = new TypeValidationAttribute();
            List<ValidationError> errors = new List<ValidationError>();
            typeNode.TypeName = GetType().AssemblyQualifiedName;
			attribute.Validate(typeNode, valueInfo1, errors, ServiceProvider);
            Assert.AreEqual(0, errors.Count);
        }
 public void ValidTypeProducesNoErrors()
 {
     TypeValidationAttribute attribute = new TypeValidationAttribute();
     ValidationErrorCollection errors = new ValidationErrorCollection();
     typeNode.TypeName = GetType().AssemblyQualifiedName;
     attribute.Validate(typeNode, valueInfo1, errors);
     Assert.AreEqual(0, errors.Count);
 }
 public void InvalidTypeProducesAnError()
 {
     TypeValidationAttribute attribute = new TypeValidationAttribute();
     typeNode.TypeName = "MyTest";
     ValidationErrorCollection errors = new ValidationErrorCollection();
     attribute.Validate(typeNode, valueInfo1, errors);
     Assert.AreEqual(1, errors.Count);
 }
Ejemplo n.º 5
0
        public void ValidTypeProducesNoErrors()
        {
            TypeValidationAttribute attribute = new TypeValidationAttribute();
            List <ValidationError>  errors    = new List <ValidationError>();

            typeNode.TypeName = GetType().AssemblyQualifiedName;
            attribute.Validate(typeNode, valueInfo1, errors, ServiceProvider);
            Assert.AreEqual(0, errors.Count);
        }
        public void ValidTypeProducesNoErrors()
        {
            TypeValidationAttribute   attribute = new TypeValidationAttribute();
            ValidationErrorCollection errors    = new ValidationErrorCollection();

            typeNode.TypeName = GetType().AssemblyQualifiedName;
            attribute.Validate(typeNode, valueInfo1, errors);
            Assert.AreEqual(0, errors.Count);
        }
Ejemplo n.º 7
0
        public void InvalidTypeProducesAnError()
        {
            TypeValidationAttribute attribute = new TypeValidationAttribute();

            typeNode.TypeName = "MyTest";
            List <ValidationError> errors = new List <ValidationError>();

            attribute.Validate(typeNode, valueInfo1, errors, ServiceProvider);
            Assert.AreEqual(1, errors.Count);
        }
        public void EmptyTypeNameProducesAnError()
        {
            TypeValidationAttribute attribute = new TypeValidationAttribute();

            typeNode.TypeName = string.Empty;
            ValidationErrorCollection errors = new ValidationErrorCollection();

            attribute.Validate(typeNode, valueInfo1, errors);
            Assert.AreEqual(1, errors.Count);
        }