public void Setup()
        {
            _logger           = new Mock <ILogger <ApplicationExtract> >();
            _qnaApiClient     = new Mock <IQnaApiClient>();
            _applyDataContext = Create.MockedDbContextFor <ApplyDataContext>();

            _inProgressApplication = ApplyGenerator.GenerateApplication(Guid.NewGuid(), "In Progress", null);
            _application           = ApplyGenerator.GenerateApplication(Guid.NewGuid(), "Submitted", DateTime.Today.AddDays(-1));

            var applications = new List <Apply> {
                _inProgressApplication, _application
            };

            _applyDataContext.Set <Apply>().AddRange(applications);
            _applyDataContext.SaveChanges();

            _sections = QnaGenerator.GenerateSectionsForApplication(_application.ApplicationId);
            _qnaApiClient.Setup(x => x.GetAllSectionsForApplication(_application.ApplicationId)).ReturnsAsync(_sections);

            _sut = new ApplicationExtract(_logger.Object, _applyDataContext, _qnaApiClient.Object);
        }
Ejemplo n.º 2
0
        public void Setup()
        {
            _logger           = new Mock <ILogger <AssessorExtract> >();
            _applyDataContext = Create.MockedDbContextFor <ApplyDataContext>();

            _reviewInProgressApplication = ApplyGenerator.GenerateApplication(Guid.NewGuid(), "GatewayAssessed", DateTime.Today.AddDays(-1))
                                           .AddExtractedApplicationDetails(true, false, false, false)
                                           .AddAssessorReviewDetails("In Progress", false);

            _application = ApplyGenerator.GenerateApplication(Guid.NewGuid(), "GatewayAssessed", DateTime.Today.AddDays(-1))
                           .AddExtractedApplicationDetails(true, false, false, false)
                           .AddAssessorReviewDetails("Approved", true);

            var applications = new List <Apply> {
                _reviewInProgressApplication, _application
            };

            _applyDataContext.Set <Apply>().AddRange(applications);
            _applyDataContext.SaveChanges();

            _adminFileExtractQueue = new Mock <IAsyncCollector <AdminFileExtractRequest> >();

            _sut = new AssessorExtract(_logger.Object, _applyDataContext);
        }
        public void Setup()
        {
            _logger           = new Mock <ILogger <AppealExtract> >();
            _applyDataContext = Create.MockedDbContextFor <ApplyDataContext>();

            _applicationWithAppealNotYetSubmitted = ApplyGenerator.GenerateApplication(Guid.NewGuid(), "Unsuccessful", DateTime.Today.AddDays(-1))
                                                    .AddExtractedApplicationDetails(true, true, true, false)
                                                    .AddAppealDetails(null, true);

            _application = ApplyGenerator.GenerateApplication(Guid.NewGuid(), "Unsuccessful", DateTime.Today.AddDays(-1))
                           .AddExtractedApplicationDetails(true, true, true, false)
                           .AddAppealDetails(DateTime.Today, true);

            var applications = new List <Apply> {
                _applicationWithAppealNotYetSubmitted, _application
            };

            _applyDataContext.Set <Apply>().AddRange(applications);
            _applyDataContext.SaveChanges();

            _appealFileExtractQueue = new Mock <IAsyncCollector <AppealFileExtractRequest> >();

            _sut = new AppealExtract(_logger.Object, _applyDataContext);
        }