NewPipeExtractor/extractor/src/test/java/org/schabi/newpipe/extractor/services/bandcamp/BandcampSuggestionExtractor...

41 lines
1.3 KiB
Java
Raw Normal View History

// Created by Fynn Godau 2019, licensed GNU GPL version 3 or later
package org.schabi.newpipe.extractor.services.bandcamp;
2021-12-27 21:08:08 +01:00
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
2021-01-15 21:55:40 +01:00
import org.schabi.newpipe.downloader.DownloaderTestImpl;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampSuggestionExtractor;
import java.io.IOException;
import java.util.List;
2021-12-27 21:08:08 +01:00
import static org.junit.jupiter.api.Assertions.assertTrue;
2020-04-20 21:55:35 +02:00
import static org.schabi.newpipe.extractor.ServiceList.Bandcamp;
/**
* Tests for {@link BandcampSuggestionExtractor}
*/
public class BandcampSuggestionExtractorTest {
private static BandcampSuggestionExtractor extractor;
2021-12-27 21:08:08 +01:00
@BeforeAll
public static void setUp() {
NewPipe.init(DownloaderTestImpl.getInstance());
2020-04-20 21:55:35 +02:00
extractor = (BandcampSuggestionExtractor) Bandcamp.getSuggestionExtractor();
}
@Test
public void testSearchExample() throws IOException, ExtractionException {
final List<String> c418 = extractor.suggestionList("c418");
assertTrue(c418.contains("C418"));
// There should be five results, but we can't be sure of that forever
assertTrue(c418.size() > 2);
}
}