public async Task AuthenticateOnNullObject_Exception()
        {
            var versioningManager = new JwtAuthenticator("foobar");
            ArgumentNullException ex;

            ex = await Assert.ThrowsAsync <ArgumentNullException>(() => versioningManager.AuthenticateAsync(requestMessage: null));

            Assert.Equal("requestMessage", ex.ParamName);

            ex = await Assert.ThrowsAsync <ArgumentNullException>(() => versioningManager.AuthenticateAsync(httpClient: null));

            Assert.Equal("httpClient", ex.ParamName);
        }
        public async Task AuthenticateWithHttpClient_Sucess(string token, string expectedAuthHeader, string errorMessage)
        {
            string error             = null;
            var    replaceAuthHeader = errorMessage == null;
            var    authenticator     = new JwtAuthenticator(token)
            {
                ReplaceAuthorizationHeader = replaceAuthHeader
            };

            authenticator.OnTrace += (msg) => error = msg;

            Assert.True(await authenticator.AuthenticateAsync(httpClient));
            Assert.Equal(replaceAuthHeader, await authenticator.AuthenticateAsync(httpClient));

            Assert.Equal(errorMessage, error);
            Assert.NotNull(httpClient.DefaultRequestHeaders.Authorization);
            Assert.Equal(authenticator.Header, httpClient.DefaultRequestHeaders.Authorization);
            Assert.Equal(expectedAuthHeader, httpClient.DefaultRequestHeaders.Authorization.ToString());
        }