Example #1
0
 public PlaybackHandler(
     IPlaybackContext playbackContext,
     IPlaybackStorageService playbackStorageService,
     string handlerName,
     IHttpClientPlaybackErrorSimulationService configService)
     : this(new HttpClientHandler(), playbackContext, playbackStorageService, handlerName, configService)
 {
 }
Example #2
0
 public MyPlaybackProxy(IPlaybackContext playbackContext, IPlaybackStorageService playbackStorageService, IHttpClientPlaybackErrorSimulationService configService) :
     base(new System.Net.Http.HttpClient())
 {
     _playbackContext        = playbackContext;
     _playbackStorageService = playbackStorageService;
     _configService          = configService;
     base.HttpClient         = HttpClientFactory.WithPlaybackContext(playbackContext, playbackStorageService, PROXY_NAME, configService);
 }
Example #3
0
        public static HttpClient WithPlaybackContext(
            IPlaybackContext playbackContext,
            IPlaybackStorageService playbackStorageService,
            string prefix,
            IHttpClientPlaybackErrorSimulationService configService)
        {
            var handler    = new PlaybackHandler(playbackContext, playbackStorageService, prefix, configService);
            var httpClient = new HttpClient(handler);

            return(httpClient);
        }
Example #4
0
 public PlaybackHandler(HttpMessageHandler innerHandler,
                        IPlaybackContext playbackContext,
                        IPlaybackStorageService playbackStorageService,
                        string handlerName,
                        IHttpClientPlaybackErrorSimulationService configService)
     : base(innerHandler)
 {
     _playbackStorageService = playbackStorageService;
     _playbackContext        = playbackContext;
     _handlerName            = handlerName;
     _config = configService.GetNamedConfig(handlerName).Result;
 }