Created
March 10, 2013 12:12
-
-
Save satoshun/5128329 to your computer and use it in GitHub Desktop.
social intent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example.mysocialintent.test; | |
import android.app.Activity; | |
import android.content.Intent; | |
import android.test.ActivityInstrumentationTestCase2; | |
import com.example.mysocialintent.MainActivity; | |
import com.example.mysocialintent.libs.MySocialIntent; | |
public class MySocialIntentTest extends ActivityInstrumentationTestCase2<MainActivity> { | |
MySocialIntent mySocialInent; | |
Activity mactivity; | |
public MySocialIntentTest(){ | |
super(MainActivity.class); | |
} | |
@Override | |
public void setUp() throws Exception { | |
mySocialInent = MySocialIntent.INSTANCE; | |
mactivity = getActivity(); | |
} | |
@Override | |
public void tearDown() throws Exception { | |
mactivity = null; | |
} | |
public void testTwitter(){ | |
Intent intent = mySocialInent.getIntent(mactivity, "test", "twitter"); | |
String className = intent.getComponent().getClassName(); | |
assertEquals(className, "com.twitter.android.PostActivity"); | |
} | |
public void testGplus(){ | |
Intent intent = mySocialInent.getIntent(mactivity, "test", "gplus"); | |
String className = intent.getComponent().getClassName(); | |
assertEquals(className, "com.google.android.apps.plus.app.ViewStreamActivity"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment