using Exam.Infrastructure.Extensions;
using FluentValidation;
using FluentValidation.Validators;
using Hotline.Exams.ExamManages;
using Hotline.Exams.Validate;
using Hotline.Share.Dtos.TestPapers;

namespace Hotline.Validators.Exams.ExamManages
{
    public class UpdateTagQuestionDtoValidator : AbstractValidator<UpdateTagQuestionDto>
    {
        public UpdateTagQuestionDtoValidator()
        {
            RuleFor(m => m.QuestionType).NotNull().WithMessage(x => string.Format(ExamErrorMessage.IsRequired, x.GetType().GetDescription(nameof(ExamTagQuestion.QuestionType))));
            //RuleFor(m => m.Count).NotEmpty().WithMessage(x => string.Format(ExamErrorMessage.IsRequired, x.GetType().GetDescription(nameof(ExamTagQuestion.Count))));
            RuleFor(m => m.TagId).NotEmpty().WithMessage(x => string.Format(ExamErrorMessage.IsRequired, typeof(ExamTag).GetDescription()));
        }
    }
}