Ejemplo n.º 1
0
        public void ApiRequestor_Constructor_ISimpleHttpClientIsNull_ArgumentNullException()
        {
            // arrange
            IHttpClientAdapter httpClient = null;

            // act
            // assert
            Assert.ThrowsException <ArgumentNullException>(() => new ApiRequestor <TestResponseData>(httpClient, responseInterpreter));
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 4
0
 public DataContext(IMappingConfiguration mapping, IHttpClientAdapter httpClientAdapter)
     : this(mapping, httpClientAdapter, new NoOpLogger())
 {
 }
Ejemplo n.º 5
0
 public DataContext(IMappingConfiguration mapping, IHttpClientAdapter httpClientAdapter, ILog logger)
 {
     mapping.Build(_model);
     _httpClientAdapter = httpClientAdapter;
     _logger            = logger;
 }
Ejemplo n.º 6
0
 public OrderUseCases(IOrderRepository orderRepository,
                      IHttpClientAdapter clientAdapter)
 {
     _orderRepository = orderRepository;
     _clientAdapter   = clientAdapter;
 }
Ejemplo n.º 7
0
 public RatingAuthorizer(IHttpClientAdapter httpClientAdapter, IConfigSettings configSettings, ILogger logger)
 {
     _httpClientAdapter = httpClientAdapter;
     _configSettings = configSettings;
     _logger = logger;
 }
Ejemplo n.º 8
0
 public PackageAuthenticator(IHttpClientAdapter httpClientAdapter, IConfigSettings configSettings, ILogger logger)
 {
     _httpClientAdapter = httpClientAdapter;
     _configSettings    = configSettings;
     _logger            = logger;
 }
Ejemplo n.º 9
0
 public OpenReferralMembershipRequestsService(IHttpClientAdapter httpClientAdapter, IConfiguration configuration)
 {
     _httpClientAdapter = httpClientAdapter;
     _ApiBaseAddress    = configuration["ORApi:BaseUrl"];
 }
Ejemplo n.º 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));
Ejemplo n.º 11
0
 public PendingOrgsService(IHttpClientAdapter httpClientAdapter, IConfiguration configuration)
 {
     _httpClientAdapter = httpClientAdapter;
     _ApiBaseAddress    = configuration["ORApi:BaseUrl"];
 }
Ejemplo n.º 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));
 }
Ejemplo n.º 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;
 }
Ejemplo n.º 15
0
 public OpenReferralOrganisationService(IHttpClientAdapter httpClientAdapter, IConfiguration configuration)
 {
     _httpClientAdapter = httpClientAdapter;
     _ApiBaseAddress    = configuration["ORApi:BaseUrl"];
 }
Ejemplo n.º 16
0
 public RatingAuthorizer(IHttpClientAdapter httpClientAdapter, IConfigSettings configSettings, ILogger logger)
 {
     _httpClientAdapter = httpClientAdapter;
     _configSettings    = configSettings;
     _logger            = logger;
 }