Exemplo n.º 1
0
        public async Task autodispose_false_reuses_httpclient()
        {
            var fac = new TestHttpClientFactoryWithCounter();
            var fc  = new FlurlClient("http://www.mysite.com")
            {
                Settings = { HttpClientFactory = fac, AutoDispose = false }
            };
            var x = await fc.GetAsync();

            var y = await fc.GetAsync();

            var z = await fc.GetAsync();

            Assert.AreEqual(1, fac.NewClientCount);
        }
Exemplo n.º 2
0
		public ClientLifetimeTests() {
			_fac = new TestHttpClientFactoryWithCounter();
			FlurlHttp.Configure(opts => opts.HttpClientFactory = _fac);
		} 
Exemplo n.º 3
0
 public ClientLifetimeTests()
 {
     _fac = new TestHttpClientFactoryWithCounter();
     FlurlHttp.Configure(settings => settings.HttpClientFactory = _fac);
 }