Exemplo n.º 1
0
        public void Arrange()
        {
            _fixture              = new Fixture();
            _accountId            = _fixture.Create <string>();
            _accountLegalEntityId = _fixture.Create <string>();

            _legalEntitiesService                  = new Mock <ILegalEntitiesService>();
            _legalEntities                         = _fixture.CreateMany <LegalEntityModel>(1).ToList();
            _legalEntities[0].AccountId            = _accountId;
            _legalEntities[0].AccountLegalEntityId = _accountLegalEntityId;
            _legalEntitiesService.Setup(x => x.Get(_accountId)).ReturnsAsync(_legalEntities);

            _applicationService = new Mock <IApprenticeshipIncentiveService>();
            var applicationsResponse = new GetApplicationsModel
            {
                BankDetailsStatus           = BankDetailsStatus.Completed,
                ApprenticeApplications      = _fixture.CreateMany <ApprenticeApplicationModel>(5).ToList(),
                FirstSubmittedApplicationId = Guid.NewGuid()
            };

            _applicationService.Setup(x => x.GetList(_accountId, _accountLegalEntityId)).ReturnsAsync(applicationsResponse);

            _configuration = new Mock <IOptions <ExternalLinksConfiguration> >();
            var config = new ExternalLinksConfiguration {
                ManageApprenticeshipSiteUrl = "https://manage-apprentices.com"
            };

            _configuration.Setup(x => x.Value).Returns(config);

            _sut = new Web.Controllers.HubController(_legalEntitiesService.Object, _applicationService.Object, _configuration.Object);
        }
 public ErrorController(ILogger <ErrorController> logger, IOptions <ExternalLinksConfiguration> externalLinks, IRecruitVacancyClient vacancyClient, ITrainingProviderSummaryProvider trainingProviderSummaryProvider)
 {
     _logger        = logger;
     _externalLinks = externalLinks.Value;
     _vacancyClient = vacancyClient;
     _trainingProviderSummaryProvider = trainingProviderSummaryProvider;
 }
Exemplo n.º 3
0
 public HomeController(
     ILegalEntitiesService legalEntitiesService,
     IOptions <ExternalLinksConfiguration> configuration)
 {
     _legalEntitiesService = legalEntitiesService;
     _configuration        = configuration.Value;
 }
Exemplo n.º 4
0
 public PaymentsController(IApplicationService applicationService, ILegalEntitiesService legalEntitiesService,
                           IOptions <ExternalLinksConfiguration> linksConfiguration)
 {
     _applicationService   = applicationService;
     _legalEntitiesService = legalEntitiesService;
     _linksConfiguration   = linksConfiguration.Value;
 }
Exemplo n.º 5
0
        public Startup(IConfiguration configuration, IHostingEnvironment env, ILoggerFactory loggerFactory)
        {
            var configBuilder = new ConfigurationBuilder()
                                .AddConfiguration(configuration)
                                .SetBasePath(Directory.GetCurrentDirectory())
                                .AddEnvironmentVariables();

#if DEBUG
            configBuilder
            .AddJsonFile("appsettings.json", optional: true)
            .AddJsonFile("appsettings.Development.json", optional: true);
#endif

            configBuilder.AddAzureTableStorage(
                options => {
                options.ConfigurationKeys       = configuration["ConfigNames"].Split(",");
                options.EnvironmentName         = configuration["Environment"];
                options.StorageConnectionString = configuration["ConfigurationStorageConnectionString"];
                options.PreFixConfigurationKeys = false;
            }
                );

            _configuration             = configBuilder.Build();
            _hostingEnvironment        = env;
            _authenticationConfig      = _configuration.GetSection("Authentication").Get <AuthenticationConfiguration>();
            _legacyAuthorizationConfig = _configuration.GetSection("LegacyAuthorization").Get <AuthorizationConfiguration>();
            _authorizationConfig       = _configuration.GetSection("Authorization").Get <AuthorizationConfiguration>();
            _externalLinks             = _configuration.GetSection("ExternalLinks").Get <ExternalLinksConfiguration>();
            _loggerFactory             = loggerFactory;
        }
 public ApplyController(
     IOptions <ExternalLinksConfiguration> configuration,
     IApplicationService applicationService,
     ILegalEntitiesService legalEntitiesService) : base(legalEntitiesService)
 {
     _configuration      = configuration.Value;
     _applicationService = applicationService;
 }
Exemplo n.º 7
0
 public PaymentsController(IApprenticeshipIncentiveService apprenticeshipIncentiveService, ILegalEntitiesService legalEntitiesService,
                           IHashingService hashingService, IOptions <ExternalLinksConfiguration> configuration)
 {
     _apprenticeshipIncentiveService = apprenticeshipIncentiveService;
     _legalEntitiesService           = legalEntitiesService;
     _hashingService = hashingService;
     _configuration  = configuration.Value;
 }
 public HubController(ILegalEntitiesService legalEntitiesService, IApplicationService applicationService,
                      IOptions <ExternalLinksConfiguration> externalLinksConfiguration, IOptions <WebConfigurationOptions> webConfiguration)
 {
     _legalEntitiesService       = legalEntitiesService;
     _applicationService         = applicationService;
     _externalLinksConfiguration = externalLinksConfiguration.Value;
     _webConfiguration           = webConfiguration.Value;
 }
Exemplo n.º 9
0
        private static string[] GetAllowableDestinations(ExternalLinksConfiguration linksConfig)
        {
            var destinations = new List <string>();

            // if (!string.IsNullOrWhiteSpace(linksConfig?.ManageApprenticeshipSiteUrl))
            //     destinations.Add(linksConfig?.ManageApprenticeshipSiteUrl);

            return(destinations.ToArray());
        }
Exemplo n.º 10
0
 public DisplayVacancyViewModelMapper(
     IGeocodeImageService mapService,
     IOptions <ExternalLinksConfiguration> externalLinksOptions,
     IRecruitVacancyClient vacancyClient)
 {
     _mapService = mapService;
     _externalLinksConfiguration = externalLinksOptions.Value;
     _vacancyClient = vacancyClient;
 }
Exemplo n.º 11
0
 public Startup(IConfiguration configuration, ILoggerFactory loggerFactory)
 {
     _configuration             = configuration;
     _authenticationConfig      = _configuration.GetSection("Authentication").Get <AuthenticationConfiguration>();
     _legacyAuthorizationConfig = _configuration.GetSection("LegacyAuthorization").Get <AuthorizationConfiguration>();
     _authorizationConfig       = _configuration.GetSection("Authorization").Get <AuthorizationConfiguration>();
     _externalLinks             = _configuration.GetSection("ExternalLinks").Get <ExternalLinksConfiguration>();
     _loggerFactory             = loggerFactory;
 }
 public ApplicationProcessOrchestrator(IProviderVacancyClient client,
                                       IRecruitVacancyClient vacancyClient,
                                       IOptions <ExternalLinksConfiguration> externalLinks, ILogger <ApplicationProcessOrchestrator> logger,
                                       IReviewSummaryService reviewSummaryService) : base(logger)
 {
     _client               = client;
     _vacancyClient        = vacancyClient;
     _externalLinks        = externalLinks.Value;
     _reviewSummaryService = reviewSummaryService;
 }
 public ConfirmationController(
     ISessionService sessionService,
     IGetProviderFeedback providerFeedbackRepo,
     IOptions <ExternalLinksConfiguration> externalLinks,
     ILogger <ConfirmationController> logger)
 {
     _sessionService       = sessionService;
     _providerFeedbackRepo = providerFeedbackRepo;
     _logger        = logger;
     _externalLinks = externalLinks.Value;
 }
 public ApplicationProcessOrchestrator(
     IRecruitVacancyClient vacancyClient,
     IOptions <ExternalLinksConfiguration> externalLinks, ILogger <ApplicationProcessOrchestrator> logger,
     IReviewSummaryService reviewSummaryService,
     IUtility utility) : base(logger)
 {
     _vacancyClient        = vacancyClient;
     _externalLinks        = externalLinks.Value;
     _reviewSummaryService = reviewSummaryService;
     _utility = utility;
 }
 public ApplyEmploymentDetailsController(
     IApplicationService applicationService,
     ILegalEntitiesService legalEntityService,
     IHashingService hashingService,
     IEmploymentStartDateValidator employmentStartDateValidator,
     IOptions <ExternalLinksConfiguration> configuration) : base(legalEntityService)
 {
     _applicationService           = applicationService;
     _hashingService               = hashingService;
     _employmentStartDateValidator = employmentStartDateValidator;
     _configuration = configuration.Value;
 }
        public void SetUp()
        {
            _legalEntitiesService = new Mock <ILegalEntitiesService>();
            _configuration        = new Mock <IOptions <ExternalLinksConfiguration> >();
            _fixture             = new Fixture();
            _accountId           = _fixture.Create <string>();
            _viewModel           = _fixture.Create <ChooseOrganisationViewModel>();
            _viewModel.AccountId = _accountId;
            _config = _fixture.Create <ExternalLinksConfiguration>();
            _configuration.Setup(x => x.Value).Returns(_config);

            _sut = new ApplyOrganisationController(_legalEntitiesService.Object, _configuration.Object);
        }
 public void Arrange()
 {
     _fixture       = new Fixture();
     _configuration = new Mock <IOptions <ExternalLinksConfiguration> >();
     _externalLinksConfiguration = new ExternalLinksConfiguration {
         ManageApprenticeshipSiteUrl = _fixture.Create <string>()
     };
     _configuration.Setup(x => x.Value).Returns(_externalLinksConfiguration); _applicationService = new Mock <IApplicationService>();
     _legalEntitiesService = new Mock <ILegalEntitiesService>();
     _accountId            = _fixture.Create <string>();
     _applicationId        = Guid.NewGuid();
     _sut = new Web.Controllers.ApplyController(_configuration.Object, _applicationService.Object, _legalEntitiesService.Object);
 }
Exemplo n.º 18
0
        public void SetUp()
        {
            _legalEntitiesService = new Mock <ILegalEntitiesService>();
            _configuration        = new Mock <IOptions <ExternalLinksConfiguration> >();
            _externalLinks        = new ExternalLinksConfiguration {
                ManageApprenticeshipSiteUrl = "https://manage-apprentices.com"
            };
            _configuration.Setup(x => x.Value).Returns(_externalLinks);
            _fixture              = new Fixture();
            _accountId            = _fixture.Create <string>();
            _accountLegalEntityId = _fixture.Create <string>();

            _sut = new Web.Controllers.HomeController(_legalEntitiesService.Object, _configuration.Object);
        }
 public BankDetailsController(IVerificationService verificationService,
                              IEmailService emailService,
                              IApplicationService applicationService,
                              IHashingService hashingService,
                              ILegalEntitiesService legalEntitiesService,
                              IOptions <ExternalLinksConfiguration> configuration) : base(legalEntitiesService)
 {
     _verificationService  = verificationService;
     _emailService         = emailService;
     _applicationService   = applicationService;
     _hashingService       = hashingService;
     _legalEntitiesService = legalEntitiesService;
     _configuration        = configuration.Value;
 }
 public VacancyPreviewOrchestrator(
     IRecruitVacancyClient vacancyClient,
     ILogger <VacancyPreviewOrchestrator> logger,
     DisplayVacancyViewModelMapper vacancyDisplayMapper,
     IReviewSummaryService reviewSummaryService,
     ILegalEntityAgreementService legalEntityAgreementService,
     IMessaging messaging,
     IOptions <ExternalLinksConfiguration> externalLinksOptions,
     IUtility utility) : base(logger)
 {
     _vacancyClient               = vacancyClient;
     _vacancyDisplayMapper        = vacancyDisplayMapper;
     _reviewSummaryService        = reviewSummaryService;
     _legalEntityAgreementService = legalEntityAgreementService;
     _messaging = messaging;
     _utility   = utility;
     _externalLinksConfiguration = externalLinksOptions.Value;
 }
Exemplo n.º 21
0
        private static string[] GetAllowableDestinations(AuthenticationConfiguration authConfig, ExternalLinksConfiguration linksConfig)
        {
            var destinations = new List <string>();

            if (!string.IsNullOrWhiteSpace(authConfig?.Authority))
            {
                destinations.Add(authConfig.Authority.Replace("identity", string.Empty));
            }

            if (!string.IsNullOrWhiteSpace(linksConfig?.ManageApprenticeshipSiteUrl))
            {
                destinations.Add(linksConfig?.ManageApprenticeshipSiteUrl);
            }

            if (!string.IsNullOrWhiteSpace(linksConfig?.CommitmentsSiteUrl))
            {
                destinations.Add(linksConfig?.CommitmentsSiteUrl);
            }

            if (!string.IsNullOrWhiteSpace(linksConfig?.EmployerFavouritesUrl))
            {
                destinations.Add(linksConfig.EmployerFavouritesUrl);
            }

            if (!string.IsNullOrWhiteSpace(linksConfig?.TrainingProviderPermissionUrl))
            {
                destinations.Add(linksConfig.TrainingProviderPermissionUrl);
            }

            if (!string.IsNullOrWhiteSpace(linksConfig?.EmployerRecruitmentApiUrl))
            {
                destinations.Add(linksConfig.EmployerRecruitmentApiUrl);
            }

            return(destinations.ToArray());
        }
Exemplo n.º 22
0
 public ErrorController(ILogger <ErrorController> logger, IOptions <ExternalLinksConfiguration> externalLinks, IRecruitVacancyClient vacancyClient)
 {
     _logger        = logger;
     _externalLinks = externalLinks.Value;
     _vacancyClient = vacancyClient;
 }
 public HubController(ILegalEntitiesService legalEntitiesService, IApprenticeshipIncentiveService applicationService, IOptions <ExternalLinksConfiguration> configuration)
 {
     _legalEntitiesService = legalEntitiesService;
     _applicationService   = applicationService;
     _configuration        = configuration.Value;
 }
Exemplo n.º 24
0
        private static string[] GetAllowableDestinations(AuthenticationConfiguration authConfig, ExternalLinksConfiguration linksConfig)
        {
            var destinations = new List <string>();

            if (!string.IsNullOrWhiteSpace(authConfig?.MetaDataAddress))
            {
                destinations.Add(ExtractAuthHost(authConfig));
            }

            if (!string.IsNullOrWhiteSpace(linksConfig?.ProviderApprenticeshipSiteUrl))
            {
                destinations.Add(linksConfig.ProviderApprenticeshipSiteUrl);
            }

            if (!string.IsNullOrWhiteSpace(linksConfig?.ProviderApprenticeshipSiteFeedbackUrl))
            {
                destinations.Add(linksConfig.ProviderApprenticeshipSiteFeedbackUrl);
            }

            if (!string.IsNullOrWhiteSpace(linksConfig?.CommitmentsSiteUrl))
            {
                destinations.Add(linksConfig.CommitmentsSiteUrl);
            }

            if (!string.IsNullOrWhiteSpace(linksConfig?.ReservationsSiteUrl))
            {
                destinations.Add(linksConfig.ReservationsSiteUrl);
            }

            return(destinations.ToArray());
        }
Exemplo n.º 25
0
        private static string[] GetAllowableDestinations(AuthenticationConfiguration authConfig, ExternalLinksConfiguration linksConfig)
        {
            var destinations = new List <string>();

            if (!string.IsNullOrWhiteSpace(authConfig?.MetaDataAddress))
            {
                destinations.Add(authConfig.MetaDataAddress);
            }

            if (!string.IsNullOrWhiteSpace(linksConfig?.StaffIdamsUrl))
            {
                destinations.Add(linksConfig.StaffIdamsUrl);
            }

            return(destinations.ToArray());
        }
Exemplo n.º 26
0
 public LogoutController(IHostingEnvironment hostingEnvironment, IOptions <ExternalLinksConfiguration> externalLinksOptions)
 {
     _hostingEnvironment = hostingEnvironment;
     _externalLinks      = externalLinksOptions.Value;
 }
 public SystemController(IOptions <ExternalLinksConfiguration> configuration)
 {
     _configuration = configuration.Value;
 }
Exemplo n.º 28
0
        private static string[] GetAllowableDestinations(AuthenticationConfiguration authConfig, ExternalLinksConfiguration linksConfig)
        {
            var destinations = new List <string>();

            if (!string.IsNullOrWhiteSpace(authConfig?.Authority))
            {
                destinations.Add(authConfig.Authority.Replace("identity", string.Empty));
            }

            if (!string.IsNullOrWhiteSpace(linksConfig?.ManageApprenticeshipSiteUrl))
            {
                destinations.Add(linksConfig?.ManageApprenticeshipSiteUrl);
            }

            return(destinations.ToArray());
        }