Skip to content

Instantly share code, notes, and snippets.

@satoshun
Created March 10, 2013 12:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save satoshun/5128329 to your computer and use it in GitHub Desktop.
Save satoshun/5128329 to your computer and use it in GitHub Desktop.
social intent
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