using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Validation;
using Microsoft.Practices.EnterpriseLibrary.Validation.Configuration;
using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using System.Collections.Specialized;
using System.Net.Mail;
using System.Text.RegularExpressions;

namespace TERASOLUNA.Fw.CommonUT.Validation.VabValidatorTestData
{
    [ConfigurationElementType(typeof(CustomValidatorData))]
    class DummyValidator01_With1Error : Validator
    {
        public DummyValidator01_With1Error(NameValueCollection attributes)
            : base(null, null)
        {
        }

        protected DummyValidator01_With1Error(string messageTemplate, string tag)
            : base(messageTemplate, tag)
        {
        }

        protected override string DefaultMessageTemplate
        {
            get { return "DummyValidator01_With1Error_fail"; }
        }

        protected override void DoValidate(object objectToValidate,
                                          object currentTarget,
                                           string key,
                                           ValidationResults validationResults)
        {
            ValidationResult result = 
                new ValidationResult(GetMessage(objectToValidate, key),currentTarget,key,Tag,this);
            validationResults.AddResult(result);
            return;
        }
    }
}
