LinkifyTestpublic class LinkifyTest extends android.test.AndroidTestCase LinkifyTest tests {@link Linkify}. |
Methods Summary |
---|
public void | testNormal()
TextView tv;
tv = new TextView(getContext());
tv.setAutoLinkMask(Linkify.ALL);
tv.setText("Hey, foo@google.com, call 415-555-1212.");
assertTrue(tv.getMovementMethod() instanceof LinkMovementMethod);
assertTrue(tv.getUrls().length == 2);
| public void | testNothing()
TextView tv;
tv = new TextView(getContext());
tv.setText("Hey, foo@google.com, call 415-555-1212.");
assertFalse(tv.getMovementMethod() instanceof LinkMovementMethod);
assertTrue(tv.getUrls().length == 0);
| public void | testUnclickable()
TextView tv;
tv = new TextView(getContext());
tv.setAutoLinkMask(Linkify.ALL);
tv.setLinksClickable(false);
tv.setText("Hey, foo@google.com, call 415-555-1212.");
assertFalse(tv.getMovementMethod() instanceof LinkMovementMethod);
assertTrue(tv.getUrls().length == 2);
|
|