use of net.rdrei.android.scdl2.ShareIntentResolver in project scdl by passy.
the class ShareIntentResolverTest method testShouldAcceptDataUri.
@Test
public void testShouldAcceptDataUri() throws ShareIntentResolverException {
ShadowIntent intent = Robolectric.shadowOf(mIntent);
intent.setData(Uri.parse("https://soundcloud.com/dj-newklear/newklear-contaminated-2"));
final ShareIntentResolver resolver = TestHelper.getInjector().getInstance(ShareIntentResolver.class);
final String result = resolver.resolve();
assertThat(result, equalTo("https://api.soundcloud.com/tracks/44276907.json?client_id=429caab2811564cb27f52a7a4964269b"));
}
use of net.rdrei.android.scdl2.ShareIntentResolver in project scdl by passy.
the class ShareIntentResolverTest method testShouldAcceptExtraIntent.
@Test
public void testShouldAcceptExtraIntent() throws ShareIntentResolverException {
ShadowIntent intent = Robolectric.shadowOf(mIntent);
intent.putExtra(Intent.EXTRA_TEXT, "http://soundcloud.com/dj-newklear/newklear-contaminated-2");
final ShareIntentResolver resolver = TestHelper.getInjector().getInstance(ShareIntentResolver.class);
final String result = resolver.resolve();
assertThat(result, equalTo("http://api.soundcloud.com/tracks/44276907.json?client_id=429caab2811564cb27f52a7a4964269b"));
}
use of net.rdrei.android.scdl2.ShareIntentResolver in project scdl by passy.
the class ShareIntentResolverTest method testResolveSoundcloudDataUrlToId.
@Test
public void testResolveSoundcloudDataUrlToId() throws ShareIntentResolverException {
ShadowIntent intent = Robolectric.shadowOf(mIntent);
intent.setData(Uri.parse("soundcloud://tracks/76738498"));
final ShareIntentResolver resolver = TestHelper.getInjector().getInstance(ShareIntentResolver.class);
final PendingDownload result = resolver.resolvePendingDownload();
assertThat(result.getId(), equalTo("76738498"));
assertThat(result.getType(), equalTo(MediaDownloadType.TRACK));
}
use of net.rdrei.android.scdl2.ShareIntentResolver in project scdl by passy.
the class ShareIntentResolverTest method testResolveToId.
@Test
public void testResolveToId() throws ShareIntentResolverException {
ShadowIntent intent = Robolectric.shadowOf(mIntent);
intent.setData(Uri.parse("https://soundcloud.com/dj-newklear/newklear-contaminated-2"));
final ShareIntentResolver resolver = TestHelper.getInjector().getInstance(ShareIntentResolver.class);
final PendingDownload result = resolver.resolvePendingDownload();
assertThat(result.getId(), equalTo("44276907"));
assertThat(result.getType(), equalTo(MediaDownloadType.TRACK));
}
use of net.rdrei.android.scdl2.ShareIntentResolver in project scdl by passy.
the class ShareIntentResolverTest method testNoSslResolveToId.
@Test
public void testNoSslResolveToId() throws ShareIntentResolverException {
ShadowIntent intent = Robolectric.shadowOf(mIntent);
intent.setData(Uri.parse("http://soundcloud.com/dj-newklear/newklear-contaminated-2"));
final ShareIntentResolver resolver = TestHelper.getInjector().getInstance(ShareIntentResolver.class);
final PendingDownload result = resolver.resolvePendingDownload();
assertThat(result.getId(), equalTo("44276907"));
assertThat(result.getType(), equalTo(MediaDownloadType.TRACK));
}
Aggregations