Example #1
0
        public void ApiRequestor_Constructor_ISimpleHttpClientIsNull_ArgumentNullException()
        {
            // arrange
            IHttpClientAdapter httpClient = null;

            // act
            // assert
            Assert.ThrowsException <ArgumentNullException>(() => new ApiRequestor <TestResponseData>(httpClient, responseInterpreter));
        }
Example #2
0
        /// <summary>
        /// Sets the <see cref="IHttpClientAdapter" /> the data fetcher uses.
        /// </summary>
        /// <param name="client">The <see cref="IHttpClientAdapter" /> to use.</param>
        public static void SetHttpClient(IHttpClientAdapter client)
        {
            if (client == null)
            {
                throw new ArgumentNullException(nameof(client));
            }

            DataFetcher.client = client;
        }
Example #3
0
 /// <summary>
 /// Construct a new O365Client.
 /// </summary>
 /// <param name="optionsAccessor">Provides access to the O365AuthenticationOptions configuration object.</param>
 /// <param name="adalFactory">Creates ADAL Authentication contexts.</param>
 /// <param name="backchannelFactory">Creates HttpClient backchannels</param>
 /// <param name="loggerFactory">Creates Loggers.</param>
 public O365Client(
     IOptions <O365AuthenticationOptions> optionsAccessor,
     IAdalFactory adalFactory,
     IBackchannelFactory backchannelFactory,
     ILoggerFactory loggerFactory)
 {
     _options     = optionsAccessor.Value ?? new O365AuthenticationOptions();
     _logger      = loggerFactory.CreateLogger(nameof(O365Client));
     _adalFactory = adalFactory;
     _backchannel = backchannelFactory.CreateBackchannel("https://outlook.office.com");
     _apiBaseUrl += _options.FromAddress;
 }
Example #4
0
 public DataContext(IMappingConfiguration mapping, IHttpClientAdapter httpClientAdapter)
     : this(mapping, httpClientAdapter, new NoOpLogger())
 {
 }
Example #5
0
 public DataContext(IMappingConfiguration mapping, IHttpClientAdapter httpClientAdapter, ILog logger)
 {
     mapping.Build(_model);
     _httpClientAdapter = httpClientAdapter;
     _logger            = logger;
 }
Example #6
0
 public OrderUseCases(IOrderRepository orderRepository,
                      IHttpClientAdapter clientAdapter)
 {
     _orderRepository = orderRepository;
     _clientAdapter   = clientAdapter;
 }
Example #7
0
 public RatingAuthorizer(IHttpClientAdapter httpClientAdapter, IConfigSettings configSettings, ILogger logger)
 {
     _httpClientAdapter = httpClientAdapter;
     _configSettings = configSettings;
     _logger = logger;
 }
Example #8
0
 public PackageAuthenticator(IHttpClientAdapter httpClientAdapter, IConfigSettings configSettings, ILogger logger)
 {
     _httpClientAdapter = httpClientAdapter;
     _configSettings    = configSettings;
     _logger            = logger;
 }
Example #9
0
 public OpenReferralMembershipRequestsService(IHttpClientAdapter httpClientAdapter, IConfiguration configuration)
 {
     _httpClientAdapter = httpClientAdapter;
     _ApiBaseAddress    = configuration["ORApi:BaseUrl"];
 }
Example #10
0
 /// <summary>
 /// Sets the <see cref="IHttpClientAdapter" /> the data fetcher uses.
 /// </summary>
 /// <param name="client">The <see cref="IHttpClientAdapter" /> to use.</param>
 public static void SetHttpClient(IHttpClientAdapter client) => Client = client ?? throw new ArgumentNullException(nameof(client));
Example #11
0
 public PendingOrgsService(IHttpClientAdapter httpClientAdapter, IConfiguration configuration)
 {
     _httpClientAdapter = httpClientAdapter;
     _ApiBaseAddress    = configuration["ORApi:BaseUrl"];
 }
Example #12
0
 public ApiRequestor(IHttpClientAdapter httpClient, IResponseInterpreter <T> responseInterpreter)
 {
     this.httpClient          = httpClient ?? throw new ArgumentNullException(nameof(httpClient));
     this.responseInterpreter = responseInterpreter ?? throw new ArgumentNullException(nameof(responseInterpreter));
 }
Example #13
0
 public PackageAuthenticator(IHttpClientAdapter httpClientAdapter, IConfigSettings configSettings, ILogger logger)
 {
     _httpClientAdapter = httpClientAdapter;
     _configSettings = configSettings;
     _logger = logger;
 }
 public RegisterManagementServiceClient(RegisterManagmentOptions options, IHttpClientAdapter httpClient, IConfiguration config)
 {
     _options    = options;
     _httpClient = httpClient;
     _config     = config;
 }
Example #15
0
 public OpenReferralOrganisationService(IHttpClientAdapter httpClientAdapter, IConfiguration configuration)
 {
     _httpClientAdapter = httpClientAdapter;
     _ApiBaseAddress    = configuration["ORApi:BaseUrl"];
 }
Example #16
0
 public RatingAuthorizer(IHttpClientAdapter httpClientAdapter, IConfigSettings configSettings, ILogger logger)
 {
     _httpClientAdapter = httpClientAdapter;
     _configSettings    = configSettings;
     _logger            = logger;
 }