示例#1
0
        public void Should_GetAccessToken_AuthorizationHeader()
        {
            // Arrange
            const string accessToken  = "access_token";
            var          accessMethod = new AuthorizationHeaderAccessMethod();
            var          request      = new HttpRequestMessage();

            // Act
            accessMethod.Set(request, accessToken);

            // Assert
            Assert.Equal(accessToken, accessMethod.Get(request));
        }
示例#2
0
        public void Should_SetAccessToken_AuthorizationHeader()
        {
            // Arrange
            const string accessToken  = "access_token";
            var          accessMethod = new AuthorizationHeaderAccessMethod();
            var          request      = new HttpRequestMessage();

            // Act
            accessMethod.Set(request, accessToken);

            // Assert
            Assert.Equal(AuthorizationHeaderAccessMethod.Scheme, request.Headers.Authorization.Scheme);
            Assert.Equal(accessToken, request.Headers.Authorization.Parameter);
        }