2017-08-08 08:42:28 +02:00
|
|
|
package org.schabi.newpipe.extractor.services.soundcloud;
|
|
|
|
|
2017-12-07 02:09:46 +01:00
|
|
|
import org.junit.BeforeClass;
|
2017-08-08 17:01:50 +02:00
|
|
|
import org.junit.Ignore;
|
2017-08-08 08:42:28 +02:00
|
|
|
import org.junit.Test;
|
|
|
|
import org.schabi.newpipe.Downloader;
|
|
|
|
import org.schabi.newpipe.extractor.InfoItem;
|
|
|
|
import org.schabi.newpipe.extractor.NewPipe;
|
|
|
|
import org.schabi.newpipe.extractor.search.SearchEngine;
|
|
|
|
import org.schabi.newpipe.extractor.search.SearchResult;
|
|
|
|
|
2017-08-08 17:01:50 +02:00
|
|
|
import static org.junit.Assert.*;
|
|
|
|
import static org.schabi.newpipe.extractor.ServiceList.SoundCloud;
|
|
|
|
|
2017-08-08 08:42:28 +02:00
|
|
|
/**
|
|
|
|
* Test for {@link SearchEngine}
|
|
|
|
*/
|
2018-01-04 18:01:25 +01:00
|
|
|
public class SoundcloudSearchEngineChannelTest extends BaseSoundcloudSearchTest {
|
2017-08-08 08:42:28 +02:00
|
|
|
|
2017-12-07 02:09:46 +01:00
|
|
|
@BeforeClass
|
|
|
|
public static void setUp() throws Exception {
|
2017-08-08 08:42:28 +02:00
|
|
|
NewPipe.init(Downloader.getInstance());
|
|
|
|
SearchEngine engine = SoundCloud.getService().getSearchEngine();
|
|
|
|
|
|
|
|
// SoundCloud will suggest "lil uzi vert" instead of "lill uzi vert"
|
|
|
|
// keep in mind that the suggestions can NOT change by country (the parameter "de")
|
2017-08-16 04:40:03 +02:00
|
|
|
result = engine.search("lill uzi vert", 0, "de", SearchEngine.Filter.CHANNEL)
|
|
|
|
.getSearchResult();
|
2017-08-08 08:42:28 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
@Test
|
2017-08-10 19:50:59 +02:00
|
|
|
public void testResultsItemType() {
|
2017-08-08 08:42:28 +02:00
|
|
|
for (InfoItem infoItem : result.resultList) {
|
2017-08-11 03:23:09 +02:00
|
|
|
assertEquals(InfoItem.InfoType.CHANNEL, infoItem.info_type);
|
2017-08-08 08:42:28 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2017-08-08 17:01:50 +02:00
|
|
|
@Ignore
|
2017-08-08 08:42:28 +02:00
|
|
|
@Test
|
|
|
|
public void testSuggestion() {
|
|
|
|
//todo write a real test
|
|
|
|
assertTrue(result.suggestion != null);
|
|
|
|
}
|
|
|
|
}
|