mirror of
https://github.com/bspeice/UNCCGameDay-Test
synced 2024-11-24 08:58:13 -05:00
Unit test for twitter
This commit is contained in:
parent
fbf0f93067
commit
2a17c78420
30
src/com/uncc/edu/gameday/twitter/TwitterClientTest.java
Normal file
30
src/com/uncc/edu/gameday/twitter/TwitterClientTest.java
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user