Ejemplo n.º 1
0
 public PlaybackHandler(
     IPlaybackContext playbackContext,
     IPlaybackStorageService playbackStorageService,
     string handlerName,
     IHttpClientPlaybackErrorSimulationService configService)
     : this(new HttpClientHandler(), playbackContext, playbackStorageService, handlerName, configService)
 {
 }
Ejemplo n.º 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);
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
 }
Ejemplo n.º 5
0
 public static bool IsPlayback(this IPlaybackContext playbackContext)
 {
     return(IsPlayback(playbackContext.PlaybackMode));
 }
Ejemplo n.º 6
0
 public PlaybackMiddleware(RequestDelegate next, IPlaybackStorageService messageStorageService, IPlaybackContext playbackContext)
 {
     _messageStorageService = messageStorageService;
     _next            = next;
     _playbackContext = playbackContext as PlaybackContext;
 }