mirror of
				https://github.com/bspeice/UNCCGameDay-Test
				synced 2025-10-30 17:00:39 -04:00 
			
		
		
		
	Unit test for twitter
This commit is contained in:
		
							
								
								
									
										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(); | ||||
| 		} | ||||
| 	} | ||||
| } | ||||
		Reference in New Issue
	
	Block a user
	 bspeice
					bspeice