예제 #1
0
        public void SetUp()
        {
            _overviewOrchestrator = new Mock <IClarificationOverviewOrchestrator>();

            _controller = new ClarificationOverviewController(_overviewOrchestrator.Object)
            {
                ControllerContext = MockedControllerContext.Setup()
            };

            _applicationViewModel = GetApplicationViewModel();
            _overviewOrchestrator.Setup(x => x.GetOverviewViewModel(It.IsAny <GetClarificationOverviewRequest>())).ReturnsAsync(_applicationViewModel);
        }
 private void AssertCommonProperties(ClarifierApplicationViewModel result)
 {
     Assert.AreEqual(_application.Id, result.Id);
     Assert.AreEqual(_application.ApplicationId, result.ApplicationId);
     Assert.AreEqual(_application.OrganisationId, result.OrgId);
     Assert.AreEqual(_contact.Email, result.ApplicantEmailAddress);
     Assert.AreEqual(_application.ApplicationStatus, result.ApplicationStatus);
     Assert.AreEqual(_application.ModerationStatus, result.ModerationStatus);
     Assert.AreEqual(_application.Assessor1Name, result.Assessor1Name);
     Assert.AreEqual(_application.Assessor2Name, result.Assessor2Name);
     Assert.AreEqual(_application.ApplyData.ModeratorReviewDetails.ModeratorName, result.ModeratorName);
     Assert.AreEqual(_application.ApplyData.ModeratorReviewDetails.ClarificationRequestedOn, result.ClarificationRequestedDate);
     Assert.AreSame(_sequences, result.Sequences);
 }
예제 #3
0
        public async Task <ClarifierApplicationViewModel> GetOverviewViewModel(GetClarificationOverviewRequest request)
        {
            var application = await _applicationApiClient.GetApplication(request.ApplicationId);

            var contact = await _applicationApiClient.GetContactForApplication(request.ApplicationId);

            var sequences = await _clarificationApiClient.GetClarificationSequences(request.ApplicationId);

            if (application is null || contact is null || sequences is null)
            {
                return(null);
            }

            var viewmodel = new ClarifierApplicationViewModel(application, contact, sequences, request.UserId);

            var savedOutcomes = await _clarificationApiClient.GetAllClarificationPageReviewOutcomes(request.ApplicationId, request.UserId);

            if (savedOutcomes is null || !savedOutcomes.Any())
            {
                viewmodel.IsReadyForClarificationConfirmation = false;
            }