コード例 #1
0
        public async Task<ActionResult> Index(Guid id, KeyDatesStatusEnum? command)
        {
            var data = await mediator.SendAsync(new GetKeyDatesSummaryInformation(id));

            var model = new DateInputViewModel(data.Dates)
            {
                IsAreaAssigned = data.IsLocalAreaSet,
                CompetentAuthority = data.CompetentAuthority,
                AssessmentDecisions = data.DecisionHistory,
                IsInterim = data.IsInterim
            };

            if (command != null)
            {
                model.Command = command.GetValueOrDefault();
                AddRelevantDateToNewDate(model);
            }

            model.ShowAssessmentDecisionLink =
                await
                    authorizationService.AuthorizeActivity(
                        ExportNotificationPermissions.CanMakeExportNotificationAssessmentDecision);

            return View(model);
        }
コード例 #2
0
        private async Task Date_InvalidInput_ValidationError(KeyDatesStatusEnum command)
        {
            var model = new DateInputViewModel();

            model.Command = command;

            var controller = GetMockAssessmentController(model);

            await controller.Index(model);

            Assert.True(controller.ModelState.ContainsKey("NewDate"));
        }
コード例 #3
0
        private async Task Date_InvalidInput_ValidationError(KeyDatesStatusEnum command)
        {
            var model = new DateInputViewModel();
            model.Command = command;

            var controller = GetMockAssessmentController(model);

            await controller.Index(model);

            Assert.True(controller.ModelState.ContainsKey("NewDate"));
        }