public CreateTagItemCommandValidator(TestntDbContext context) : base(context)
 {
     RuleFor(v => v.Name)
     .MaximumLength(50)
     .NotEmpty()
     .WithMessage("Tag name is required.")
     .MustAsync((command, _, cancellation) => HaveUniqueName(command))
     .WithMessage("Project name already exists.");
 }
Пример #2
0
 public CreateStepItemCommandValidator(TestntDbContext context) : base(context)
 {
     RuleFor(v => v.Description)
     .MaximumLength(300)
     .NotEmpty()
     .WithName("Description")
     .NotNull()
     .WithName("Description")
     .MustAsync((command, _, cancellation) => HaveUniqueName(command))
     .WithMessage(c => $"Test step'{c.Description}' is already existed");
 }
 public ProjectComponentRequestValidator(TestntDbContext context)
 {
     this.context = context;
     RuleFor(v => v.ProjectId)
     .NotEmpty()
     .WithName("Project id")
     .NotNull()
     .WithName("Project id")
     .MustAsync((command, _, cancellation) => ProjectExist(command))
     .WithMessage("'Project id' is not exist");
 }
Пример #4
0
        public CreateTestProjectCommandValidator(TestntDbContext context)
        {
            this.context = context;
            RuleFor(v => v.Name)
            .MaximumLength(50)
            .NotEmpty()
            .WithMessage("Project name is required.")
            .MustAsync((name, cancellation) => HaveUniqueName(name))
            .WithMessage("Project name already exists.")
            ;

            RuleFor(v => v.IsEnabled)
            .Must(v => v == false || v == true)
            .WithName("IsEnabled")
            .NotNull()
            .WithName("IsEnabled")
            ;
        }
Пример #5
0
        public CreateScenarioItemCommandValidator(TestntDbContext context) : base(context)
        {
            RuleFor(v => v.Name)
            .MaximumLength(150)
            .NotEmpty()
            .WithName("Test scenario name")
            .NotNull()
            .WithName("Test scenario name")
            .MustAsync((command, _, cancellation) => HaveUniqueNameWithinOneProject(command))
            .WithMessage(c => $"Test case name '{c.Name}' is already existed in this project ({c.ProjectId})");

            RuleFor(v => v.TagIds)
            .NotNull()
            .WithMessage("'Tags' cannot be set to null and is optional parameter")
            .MustAsync((command, _, cancellation) => TagsExist(command));

            RuleFor(v => v.Description)
            .MaximumLength(300);
        }
Пример #6
0
 public GetProjectItemQueryHandler(TestntDbContext context, IMapper mapper)
 {
     this.context = context;
     this.mapper  = mapper;
 }
Пример #7
0
 public CreateStepItemCommandHandler(TestntDbContext context)
 {
     this.context = context;
 }
Пример #8
0
 public GetTestTagListQueryHandler(TestntDbContext context, IMapper mapper)
 {
     this.context = context;
     this.mapper  = mapper;
 }
Пример #9
0
 public GetProjectScenarioListQueryHandler(TestntDbContext context, IMapper mapper)
 {
     this.context = context;
     this.mapper  = mapper;
 }
Пример #10
0
 public CreateFeatureItemCommandValidator(TestntDbContext context) : base(context)
 {
 }
Пример #11
0
 public UpdateTestProjectItemCommandHandler(TestntDbContext context)
 {
     this.context = context;
 }
Пример #12
0
 public DeleteProjectItemCommandHandler(TestntDbContext context)
 {
     this.context = context;
 }
Пример #13
0
 public DataSeed(TestntDbContext testntDbContext, ILogger <DataSeed> logger)
 {
     this.testntDbContext = testntDbContext;
     this.logger          = logger;
 }
Пример #14
0
 public CreateTestScenarioItemCommandHandler(TestntDbContext context)
 {
     this.context = context;
 }