public void Setup() 
        {
		    twitter = new TwitterTemplate("API_KEY", "API_SECRET", "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET");
		    mockServer = MockRestServiceServer.CreateServer(twitter.RestTemplate);
		    responseHeaders = new HttpHeaders();
		    responseHeaders.ContentType = MediaType.APPLICATION_JSON;
	    }
 public void Setup()
 {
     twitter                     = new TwitterTemplate("API_KEY", "API_SECRET", "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET");
     mockServer                  = MockRestServiceServer.CreateServer(twitter.RestTemplate);
     responseHeaders             = new HttpHeaders();
     responseHeaders.ContentType = MediaType.APPLICATION_JSON;
 }
	    public void Setup() 
        {
		    twitter = new TwitterTemplate("API_KEY", "API_SECRET", "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET");
		    mockServer = MockRestServiceServer.CreateServer(twitter.RestTemplate);
		    responseHeaders = new HttpHeaders();
		    responseHeaders.ContentType = MediaType.APPLICATION_JSON;

            unauthorizedTwitter = new TwitterTemplate();
            // TODO: create a mock server just to avoid hitting real twitter if something gets past the authorization check
            //MockRestServiceServer.CreateServer(unauthorizedTwitter.RestTemplate);
	    }
 public SpecificationsBase()
 {
     twitter = new TwitterTemplate("API_KEY", "API_SECRET", "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET");
     mockServer = MockRestServiceServer.CreateServer(twitter.RestTemplate);
     dbContextFactory = () => new TestDbContext();
     containerFactory = dbContext => new Container
                                         {
                                             RepositoryFactory =
                                                 () => new SimpleRepository(dbContext ?? dbContextFactory()),
                                         };
     sessionFactory = () => new TestSessionAdapter();
 }
Esempio n. 5
0
        static void Main(string[] args)
        {
            string consumerKey = ConfigurationManager.AppSettings["twitterConsumerKey"]; // The application's consumer key
            string consumerSecret = ConfigurationManager.AppSettings["twitterConsumerSecret"]; // The application's consumer secret
            string accessToken = ConfigurationManager.AppSettings["twitterOAuthAccessToken"]; // The access token granted after OAuth authorization
            string accessTokenSecret = ConfigurationManager.AppSettings["twitterOAuthAccessTokenSecret"]; // The access token secret granted after OAuth authorization

            string twitterHandle = "frozenbytes";

            ITwitter twitter = new TwitterTemplate(consumerKey, consumerSecret, accessToken, accessTokenSecret);

            //RunRavenEmbedded(twitter, twitterHandle);
            RunRavenIIS(twitter, twitterHandle);
        }
	    public void IsAuthorizedForUser_NotAuthorized() 
        {
		    TwitterTemplate twitter = new TwitterTemplate();
            Assert.IsFalse(twitter.IsAuthorized);
	    }
	    public void IsAuthorizedForUser() 
        {
		    TwitterTemplate twitter = new TwitterTemplate("API_KEY", "API_SECRET", "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET");
		    Assert.IsTrue(twitter.IsAuthorized);
	    }
Esempio n. 8
0
        public void IsAuthorizedForUser()
        {
            TwitterTemplate twitter = new TwitterTemplate("API_KEY", "API_SECRET", "ACCESS_TOKEN", "ACCESS_TOKEN_SECRET");

            Assert.IsTrue(twitter.IsAuthorized);
        }