public void InitializeRequest_Sets_Request_Headers()
        {
            var req = new Request("https://api.twitter.com/statuses/public.json");
            const string UserAgent = "LINQ to Twitter v2.0";
            var pinAuth = new PinAuthorizer();
            var oAuthMock = new Mock<IOAuthTwitter>();
            string outUrl;
            string queryString = "oauth_token=token";
            oAuthMock.Setup(oAuth => oAuth.GetOAuthQueryString(HttpMethod.GET, req, string.Empty, out outUrl, out queryString));
            pinAuth.OAuthTwitter = oAuthMock.Object;

            pinAuth.UserAgent = UserAgent;
            pinAuth.ReadWriteTimeout = new TimeSpan(0, 0, 1);
            pinAuth.Timeout = new TimeSpan(0, 0, 2);
            pinAuth.UseCompression = true;

            var httpReq = pinAuth.Get(req) as HttpWebRequest;

            Assert.NotNull(httpReq);
            Assert.Equal(UserAgent, httpReq.UserAgent);
            Assert.Equal(1000, httpReq.ReadWriteTimeout);
            Assert.Equal(2000, httpReq.Timeout);
            Assert.Equal("gzip, deflate", httpReq.Headers[HttpRequestHeader.AcceptEncoding]);
            Assert.Equal(DecompressionMethods.Deflate | DecompressionMethods.GZip, httpReq.AutomaticDecompression);
        }
        public void Get_Calls_GetOAuthQueryString()
        {
            var req = new Request("https://api.twitter.com/statuses/public.json");
            var pinAuth = new PinAuthorizer();
            var oAuthMock = new Mock<IOAuthTwitter>();
            string outUrl;
            string queryString = "oauth_token=token";
            oAuthMock.Setup(oAuth => oAuth.GetOAuthQueryString(HttpMethod.GET, req, string.Empty, out outUrl, out queryString));
            pinAuth.OAuthTwitter = oAuthMock.Object;

            pinAuth.Get(req);

            oAuthMock.Verify(oAuth => oAuth.GetOAuthQueryString(HttpMethod.GET, req, string.Empty, out outUrl, out queryString), Times.Once());
        }