NewPipeExtractor/src/test/java/org/schabi/newpipe/extractor/services/soundcloud/SoundcloudSearchEngineChann...

45 lines
1.4 KiB
Java
Raw Normal View History

2017-08-08 08:42:28 +02:00
package org.schabi.newpipe.extractor.services.soundcloud;
import org.junit.BeforeClass;
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;
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}
*/
public class SoundcloudSearchEngineChannelTest extends BaseSoundcloudSearchTest {
2017-08-08 08:42:28 +02: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")
result = engine.search("lill uzi vert", 0, "de", SearchEngine.Filter.CHANNEL)
.getSearchResult();
2017-08-08 08:42:28 +02:00
}
@Test
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
}
}
@Ignore
2017-08-08 08:42:28 +02:00
@Test
public void testSuggestion() {
//todo write a real test
assertTrue(result.suggestion != null);
}
}