Ejemplo n.º 1
0
        public IActionResult CreateTask(CreateForm create_form)
        {
            _logger.LogInformation($"CreateTask {nameof(create_form)} - {JsonConvert.SerializeObject(create_form)}");

            var errors = _taskFormValidationService.Validate(create_form).ToList();

            if (!errors.Any())
            {
                var issue_key = _taskCreateService.CreateTask(create_form, _userInfoService.GetUserInfo());
                return(Redirect(MakeUrlToIssue(issue_key)));
            }

            return(new JsonResult(errors));
        }
Ejemplo n.º 2
0
        public void Validate_TaskCodeWithSrs_EmptySrsLinkMessage(TaskCode task_code)
        {
            var form = new CreateForm
            {
                Task = task_code
            };

            var result = _taskFormValidationService.Validate(form).ToList();

            result.Should().Contain(x => x.ErrorMessage == TaskFormValidationService.EmptySrsLink);
        }