Unit test for twitter

This commit is contained in:
bspeice 2013-11-06 12:16:58 -05:00
parent fbf0f93067
commit 2a17c78420

View File

@ -0,0 +1,30 @@
package com.uncc.edu.gameday.twitter;
import java.util.List;
import twitter4j.Status;
import twitter4j.TwitterException;
import android.test.AndroidTestCase;
import com.uncc.gameday.R;
import com.uncc.gameday.twitter.TwitterClient;
public class TwitterClientTest extends AndroidTestCase {
public void testTwitter(){
// Test the twitter4j logic
String handle = this.mContext.getString(R.string.gameday_handle);
System.out.println(handle);
try{
TwitterClient tc = new TwitterClient();
List<Status> l = tc.fetchTweets(handle, 5);
assertEquals(5, l.size());
} catch (TwitterException e) {
e.printStackTrace();
fail();
}
}
}