public void ApiRequestor_Constructor_ISimpleHttpClientIsNull_ArgumentNullException() { // arrange IHttpClientAdapter httpClient = null; // act // assert Assert.ThrowsException <ArgumentNullException>(() => new ApiRequestor <TestResponseData>(httpClient, responseInterpreter)); }
/// <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; }
/// <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; }
public DataContext(IMappingConfiguration mapping, IHttpClientAdapter httpClientAdapter) : this(mapping, httpClientAdapter, new NoOpLogger()) { }
public DataContext(IMappingConfiguration mapping, IHttpClientAdapter httpClientAdapter, ILog logger) { mapping.Build(_model); _httpClientAdapter = httpClientAdapter; _logger = logger; }
public OrderUseCases(IOrderRepository orderRepository, IHttpClientAdapter clientAdapter) { _orderRepository = orderRepository; _clientAdapter = clientAdapter; }
public RatingAuthorizer(IHttpClientAdapter httpClientAdapter, IConfigSettings configSettings, ILogger logger) { _httpClientAdapter = httpClientAdapter; _configSettings = configSettings; _logger = logger; }
public PackageAuthenticator(IHttpClientAdapter httpClientAdapter, IConfigSettings configSettings, ILogger logger) { _httpClientAdapter = httpClientAdapter; _configSettings = configSettings; _logger = logger; }
public OpenReferralMembershipRequestsService(IHttpClientAdapter httpClientAdapter, IConfiguration configuration) { _httpClientAdapter = httpClientAdapter; _ApiBaseAddress = configuration["ORApi:BaseUrl"]; }
/// <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));
public PendingOrgsService(IHttpClientAdapter httpClientAdapter, IConfiguration configuration) { _httpClientAdapter = httpClientAdapter; _ApiBaseAddress = configuration["ORApi:BaseUrl"]; }
public ApiRequestor(IHttpClientAdapter httpClient, IResponseInterpreter <T> responseInterpreter) { this.httpClient = httpClient ?? throw new ArgumentNullException(nameof(httpClient)); this.responseInterpreter = responseInterpreter ?? throw new ArgumentNullException(nameof(responseInterpreter)); }
public RegisterManagementServiceClient(RegisterManagmentOptions options, IHttpClientAdapter httpClient, IConfiguration config) { _options = options; _httpClient = httpClient; _config = config; }
public OpenReferralOrganisationService(IHttpClientAdapter httpClientAdapter, IConfiguration configuration) { _httpClientAdapter = httpClientAdapter; _ApiBaseAddress = configuration["ORApi:BaseUrl"]; }