Example #1
0
        internal EhlHttpClient(
            HttpMessageHandler messageHandler,
            IPersistAttachments attachmentPersister)
        {
            _attachmentPersister = attachmentPersister;

            _httpClient = new HttpClient(messageHandler)
            {
                Timeout = TimeSpan.FromSeconds(45)
            };

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
        }
Example #2
0
        public EnergyProviderAdapter(
            string providerName,
            string brandCodePrefix,
            Func <HttpMessageHandler, HttpMessageHandler> messageHandlerDecorator,
            IPersistAttachments attachmentPersister)
        {
            _providerName    = providerName;
            _brandCodePrefix = brandCodePrefix;

            _ehlCommsAggregator = new EhlCommsAggregator(
                new EhlApiCalls(
                    new EhlHttpClient(messageHandlerDecorator, attachmentPersister)));
        }
Example #3
0
 public void Setup()
 {
     AttachmentPersister = Mock.Of <IPersistAttachments>();
 }
Example #4
0
 public EhlHttpClient(
     Func <HttpMessageHandler, HttpMessageHandler> messageHandlerDecorator,
     IPersistAttachments attachmentPersister)
     : this(messageHandlerDecorator(new HttpClientHandler()), attachmentPersister)
 {
 }