public CenturyLinkCloudServiceFactory(string username, string password, Uri proxyUri)
        {
            var serializerSettings = new JsonSerializerSettings
            {
                ContractResolver = new CamelCasePropertyNamesContractResolver(),
                Converters = new List<JsonConverter> { new StringEnumConverter{CamelCaseText = true}}
            };

            var authProviderClient = HttpClientFactory.Create(new JsonMediaTypeHandler());
            var authProviderWrapper = new HttpClientWrapper(authProviderClient, serializerSettings);
            _authenticationProvider = new AuthenticationProvider(username, password, authProviderWrapper);

            var authHandler = new AuthenticationHandler(_authenticationProvider);
            var authorizedClient = HttpClientFactory.Create(authHandler, new JsonMediaTypeHandler());

            authProviderClient.BaseAddress = authorizedClient.BaseAddress = proxyUri;

            _clientWrapper = new HttpClientWrapper(authorizedClient, serializerSettings);
        }
        public void SendAsync_AddsAcceptHeader()
        {
            var innerHandler = new Mock<HttpClientHandler>();
            var authProvider = new Mock<ITokenProvider>();
            var testObject = new AuthenticationHandler(authProvider.Object) {InnerHandler = innerHandler.Object};
            var request = new HttpRequestMessage();

            innerHandler.Protected()
                        .Setup<Task<HttpResponseMessage>>("SendAsync", ItExpr.IsAny<HttpRequestMessage>(), ItExpr.IsAny<CancellationToken>())
                        .Returns(Task.FromResult(new HttpResponseMessage()));
            authProvider.Setup(x=>x.GetBearerToken())
                        .Returns(Task.FromResult("token value"));

            new HttpMessageInvoker(testObject)
                .SendAsync(request, CancellationToken.None)
                .Wait();

            Assert.NotNull(request.Headers.Authorization);
            Assert.AreEqual("Bearer", request.Headers.Authorization.Scheme);
            Assert.AreEqual("token value", request.Headers.Authorization.Parameter);
        }