private void SetTestMode(OpenStackNetConfigurationOptions options) { options.FlurlHttpSettings.HttpClientFactory = new TestHttpClientFactory(this); options.FlurlHttpSettings.AfterCall = call => { CallLog.Add(call); }; }
public HttpTest() { FlurlHttp.Configure(settings => { settings.HttpClientFactory = new TestHttpClientFactory(this); settings.AfterCall = call => CallLog.Add(call); }); ResponseQueue = new Queue <HttpResponseMessage>(); CallLog = new List <HttpCall>(); }
/// <summary> /// Initializes a new instance of the <see cref="HttpTest"/> class. /// </summary> public HttpTest() { FlurlHttp.Configure(opts => { opts.HttpClientFactory = new TestHttpClientFactory(this); opts.AfterCall = call => // Restore handler which was nuked by the base HttpTest { CallLog.Add(call); OpenStackNet.Tracing.TraceHttpCall(call); }; }); }