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

namespace Hotline.Validators.Exams.TestPapers
{
    public class UpdateTestPaperRuleDtoValidator : AbstractValidator<UpdateTestPaperRuleDto>
    {
        public UpdateTestPaperRuleDtoValidator()
        {
            RuleFor(m => m.QuestionType).NotNull().WithMessage(x => string.Format(ExamErrorMessage.IsRequired, x.GetType().GetDescription(nameof(ExamTestPaperRule.QuestionType))));

            RuleFor(m => m.Count).NotNull().WithMessage(x => string.Format(ExamErrorMessage.IsRequired, x.GetType().GetDescription(nameof(ExamTestPaperRule.QuestionType))));
        }
    }
}