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."); }
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"); }
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") ; }
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); }
public GetProjectItemQueryHandler(TestntDbContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public CreateStepItemCommandHandler(TestntDbContext context) { this.context = context; }
public GetTestTagListQueryHandler(TestntDbContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public GetProjectScenarioListQueryHandler(TestntDbContext context, IMapper mapper) { this.context = context; this.mapper = mapper; }
public CreateFeatureItemCommandValidator(TestntDbContext context) : base(context) { }
public UpdateTestProjectItemCommandHandler(TestntDbContext context) { this.context = context; }
public DeleteProjectItemCommandHandler(TestntDbContext context) { this.context = context; }
public DataSeed(TestntDbContext testntDbContext, ILogger <DataSeed> logger) { this.testntDbContext = testntDbContext; this.logger = logger; }
public CreateTestScenarioItemCommandHandler(TestntDbContext context) { this.context = context; }