ShareTweetAction implements View.OnClickListener { Intent getShareIntent(String subject, String content) { final Intent intent = new Intent(); intent.setAction(Intent.ACTION_SEND); intent.putExtra(Intent.EXTRA_SUBJECT, subject); intent.putExtra(Intent.EXTRA_TEXT, content); intent.setType("text/plain"); return intent; } ShareTweetAction(Tweet tweet, TweetUi tweetUi); @Override void onClick(View v);  }
@Test public void testGetShareIntent() { final Intent intent = listener.getShareIntent(A_SHARE_SUBJECT, A_SHARE_TEXT); assertEquals(REQUIRED_SEND_ACTION, intent.getAction()); assertEquals(REQUIRED_MIME_TYPE, intent.getType()); assertEquals(A_SHARE_SUBJECT, intent.getStringExtra(Intent.EXTRA_SUBJECT)); assertEquals(A_SHARE_TEXT, intent.getStringExtra(Intent.EXTRA_TEXT)); }