public ApprenticeshipVacancyApiTests()
 {
     fakeLogger           = A.Fake <ILogger <ApprenticeshipVacancyApi> >();
     auditService         = A.Fake <IAuditService>();
     aVAPIServiceSettings = new AVAPIServiceSettings()
     {
         FAAMaxPagesToTryPerMapping = 100, FAAEndPoint = "https://doesnotgoanywhere.com", RequestTimeOutSeconds = 10
     };
 }
Exemple #2
0
 public AVAPIServiceHealthStatusCheckTests()
 {
     fakeLogger           = A.Fake <ILogger <AVAPIService> >();
     aVAPIServiceSettings = new AVAPIServiceSettings()
     {
         FAAMaxPagesToTryPerMapping = 100
     };
     fakeApprenticeshipVacancyApi = A.Fake <IApprenticeshipVacancyApi>();
     aVAPIServiceSettings.StandardsForHealthCheck = A.Dummy <string>();
     dummyHealthCheckContext = A.Dummy <HealthCheckContext>();
 }
Exemple #3
0
        public ApprenticeshipVacancyApi(ILogger <ApprenticeshipVacancyApi> logger, IAuditService auditService, AVAPIServiceSettings aVAPIServiceSettings, HttpClient httpClient)
        {
            this.logger               = logger;
            this.auditService         = auditService;
            this.aVAPIServiceSettings = aVAPIServiceSettings ?? throw new ArgumentNullException(nameof(aVAPIServiceSettings));
            this.httpClient           = httpClient ?? throw new ArgumentNullException(nameof(httpClient));

            this.httpClient.DefaultRequestHeaders.Add("Ocp-Apim-Subscription-Key", aVAPIServiceSettings.FAASubscriptionKey);
            this.httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
            this.httpClient.Timeout = TimeSpan.FromSeconds(aVAPIServiceSettings.RequestTimeOutSeconds);
            correlationId           = Guid.NewGuid();
        }
Exemple #4
0
 public AVAPIServiceTests()
 {
     fakeLogger           = A.Fake <ILogger <AVAPIService> >();
     aVAPIServiceSettings = new AVAPIServiceSettings()
     {
         FAAMaxPagesToTryPerMapping = 100
     };
     fakeApprenticeshipVacancyApi = A.Fake <IApprenticeshipVacancyApi>();
     aVMapping = new AVMapping
     {
         Standards  = new string[] { "225" },
         Frameworks = new string[] { "512" },
     };
 }
 public AVAPIService(IApprenticeshipVacancyApi apprenticeshipVacancyApi, ILogger <AVAPIService> logger, AVAPIServiceSettings aVAPIServiceSettings)
 {
     this.apprenticeshipVacancyApi = apprenticeshipVacancyApi;
     this.logger = logger;
     this.aVAPIServiceSettings = aVAPIServiceSettings;
 }