Ejemplo n.º 1
0
        public void CanExchangeForAccessToken()
        {
            var service = new WeiboService(_consumerKey, _consumerSecret);

            ////var service = new WeiboService(_iphoneConsumerKey, _iphoneConsumerSecret);

            var requestToken = service.GetRequestToken();

            AssertResultWas(service, HttpStatusCode.OK);
            Assert.NotNull(requestToken);

            var uri = service.GetAuthorizationUri(requestToken);
            Process.Start(uri.ToString());

            Console.WriteLine("Press the any key when you have confirmation of your code transmission.");

            string verifier = "233312";
            var accessToken = service.GetAccessToken(requestToken, verifier);
            AssertResultWas(service, HttpStatusCode.OK);
            Assert.IsNotNull(accessToken);
        }
Ejemplo n.º 2
0
        public void CanExchangeForAccessToken()
        {
            var service = new WeiboService(_consumerKey, _consumerSecret);

            ////var service = new WeiboService(_iphoneConsumerKey, _iphoneConsumerSecret);

            var requestToken = service.GetRequestToken();

            AssertResultWas(service, HttpStatusCode.OK);
            Assert.NotNull(requestToken);

            var uri = service.GetAuthorizationUri(requestToken);

            Process.Start(uri.ToString());

            Console.WriteLine("Press the any key when you have confirmation of your code transmission.");

            string verifier    = "233312";
            var    accessToken = service.GetAccessToken(requestToken, verifier);

            AssertResultWas(service, HttpStatusCode.OK);
            Assert.IsNotNull(accessToken);
        }
Ejemplo n.º 3
0
        public void Can_make_protected_resource_request_with_access_token()
        {
            var service      = new WeiboService(_consumerKey, _consumerSecret);
            var requestToken = service.GetRequestToken();

            AssertResultWas(service, HttpStatusCode.OK);
            Assert.NotNull(requestToken);

            var uri = service.GetAuthorizationUri(requestToken);

            Process.Start(uri.ToString());

            Console.WriteLine("Press the any key when you have confirmation of your code transmission.");

            string verifier    = "394973";
            var    accessToken = service.GetAccessToken(requestToken, verifier);

            AssertResultWas(service, HttpStatusCode.OK);
            Assert.IsNotNull(accessToken);

            service.AuthenticateWith(accessToken.Token, accessToken.TokenSecret);
            ////var mentions = service
        }
Ejemplo n.º 4
0
        public void Can_make_protected_resource_request_with_access_token()
        {
            var service = new WeiboService(_consumerKey, _consumerSecret);
            var requestToken = service.GetRequestToken();

            AssertResultWas(service, HttpStatusCode.OK);
            Assert.NotNull(requestToken);

            var uri = service.GetAuthorizationUri(requestToken);
            Process.Start(uri.ToString());

            Console.WriteLine("Press the any key when you have confirmation of your code transmission.");

            string verifier = "394973";
            var accessToken = service.GetAccessToken(requestToken, verifier);
            AssertResultWas(service, HttpStatusCode.OK);
            Assert.IsNotNull(accessToken);

            service.AuthenticateWith(accessToken.Token, accessToken.TokenSecret);
            ////var mentions = service
        }