Beispiel #1
0
 public ApprenticeshipService(
     IDASHelper DASHelper,
     IProviderServiceClient providerServiceClient,
     TelemetryClient telemetryClient,
     ISqlQueryDispatcher sqlQueryDispatcher,
     ICosmosDbQueryDispatcher cosmosDbQueryDispatcher)
 {
     _DASHelper               = DASHelper ?? throw new ArgumentNullException(nameof(DASHelper));
     _providerServiceClient   = providerServiceClient ?? throw new ArgumentNullException(nameof(providerServiceClient));
     _telemetryClient         = telemetryClient ?? throw new ArgumentNullException(nameof(telemetryClient));
     _sqlQueryDispatcher      = sqlQueryDispatcher;
     _cosmosDbQueryDispatcher = cosmosDbQueryDispatcher ?? throw new ArgumentNullException(nameof(cosmosDbQueryDispatcher));
 }
Beispiel #2
0
 public ApprenticeshipService(
     ICosmosDbHelper cosmosDbHelper,
     IOptions <CosmosDbCollectionSettings> cosmosSettings,
     IDASHelper DASHelper,
     IProviderServiceClient providerServiceClient,
     IReferenceDataServiceClient referenceDataServiceClient,
     TelemetryClient telemetryClient)
 {
     _cosmosDbHelper             = cosmosDbHelper ?? throw new ArgumentNullException(nameof(cosmosDbHelper));
     _cosmosSettings             = cosmosSettings?.Value ?? throw new ArgumentNullException(nameof(cosmosSettings));
     _DASHelper                  = DASHelper ?? throw new ArgumentNullException(nameof(DASHelper));
     _providerServiceClient      = providerServiceClient ?? throw new ArgumentNullException(nameof(providerServiceClient));
     _referenceDataServiceClient = referenceDataServiceClient ?? throw new ArgumentNullException(nameof(referenceDataServiceClient));
     _telemetryClient            = telemetryClient ?? throw new ArgumentNullException(nameof(telemetryClient));
 }
        public GetApprenticeshipsAsProviderIntegrationTests()
        {
            _nowUtc            = new Mock <Func <DateTimeOffset> >();
            _blobStorageClient = new Mock <IBlobStorageClient>();

            _providerService         = new Mock <IProviderService>();
            _providerServiceClient   = new ProviderServiceClient(_providerService.Object);
            _cosmosDbQueryDispatcher = new Mock <ICosmosDbQueryDispatcher>();
            _sqlQueryDispatcher      = new Mock <ISqlQueryDispatcher>();

            var telemetryClient = MockTelemetryHelper.Initialize();

            _DASHelper             = new DASHelper(telemetryClient);
            _apprenticeshipService = new ApprenticeshipService(_DASHelper, _providerServiceClient, telemetryClient, _sqlQueryDispatcher.Object, _cosmosDbQueryDispatcher.Object);

            _generateProviderExportFunction      = new GenerateProviderExportFunction(_apprenticeshipService, _blobStorageClient.Object);
            _getApprenticeshipAsProviderFunction = new GetApprenticeshipsAsProvider(_blobStorageClient.Object, _nowUtc.Object);
        }
Beispiel #4
0
        public GetApprenticeshipsAsProviderIntegrationTests()
        {
            _telemetryClient   = new TelemetryClient();
            _nowUtc            = new Mock <Func <DateTimeOffset> >();
            _blobStorageClient = new Mock <IBlobStorageClient>();
            _cosmosDbHelper    = new Mock <ICosmosDbHelper>();
            _cosmosSettings    = Options.Create(new CosmosDbCollectionSettings());

            _referenceDataResponse = new Mock <Func <HttpRequestMessage, CancellationToken, Task <HttpResponseMessage> > >();
            _referenceDataService  = new ReferenceDataService(new HttpClient(new MockHttpMessageHandler(_referenceDataResponse.Object))
            {
                BaseAddress = new Uri("https://test.com")
            });
            _referenceDataServiceClient = new ReferenceDataServiceClient(_referenceDataService);
            _providerService            = new Mock <IProviderService>();
            _providerServiceClient      = new ProviderServiceClient(_providerService.Object);

            _DASHelper             = new DASHelper(_telemetryClient);
            _apprenticeshipService = new ApprenticeshipService(_cosmosDbHelper.Object, _cosmosSettings, _DASHelper, _providerServiceClient, _referenceDataServiceClient, _telemetryClient);

            _generateProviderExportFunction      = new GenerateProviderExportFunction(_apprenticeshipService, _blobStorageClient.Object);
            _getApprenticeshipAsProviderFunction = new GetApprenticeshipsAsProvider(_blobStorageClient.Object, _nowUtc.Object);
        }