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 DummyValidator03_With3Error : Validator
    {
        public DummyValidator03_With3Error(NameValueCollection attributes)
            : base(null, null)
        {
        }

        protected DummyValidator03_With3Error(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 result1 = 
                new ValidationResult(GetMessage(objectToValidate, key)+"1",currentTarget,key,Tag,this);
            ValidationResult result2 =
                new ValidationResult(GetMessage(objectToValidate, key)+"2", currentTarget, key, Tag, this);
            ValidationResult result3 =
                new ValidationResult(GetMessage(objectToValidate, key)+"3", currentTarget, key, Tag, this);
            validationResults.AddResult(result1);
            validationResults.AddResult(result2);
            validationResults.AddResult(result3);

            return;
        }
    }
}
