コード例 #1
0
ファイル: EhlHttpClient.cs プロジェクト: AaronRodrigues/baas
        internal EhlHttpClient(
            HttpMessageHandler messageHandler,
            IPersistAttachments attachmentPersister)
        {
            _attachmentPersister = attachmentPersister;

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

            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;
        }
コード例 #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)));
        }
コード例 #3
0
ファイル: ClientTestBase.cs プロジェクト: AaronRodrigues/baas
 public void Setup()
 {
     AttachmentPersister = Mock.Of <IPersistAttachments>();
 }
コード例 #4
0
ファイル: EhlHttpClient.cs プロジェクト: AaronRodrigues/baas
 public EhlHttpClient(
     Func <HttpMessageHandler, HttpMessageHandler> messageHandlerDecorator,
     IPersistAttachments attachmentPersister)
     : this(messageHandlerDecorator(new HttpClientHandler()), attachmentPersister)
 {
 }