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

56 lines
1.9 KiB
Java
Raw Normal View History

2022-10-25 21:13:16 +02:00
package org.schabi.newpipe.extractor.services.bandcamp;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import org.schabi.newpipe.downloader.DownloaderTestImpl;
import org.schabi.newpipe.extractor.NewPipe;
import org.schabi.newpipe.extractor.exceptions.ExtractionException;
import org.schabi.newpipe.extractor.exceptions.ParsingException;
2022-11-04 23:47:44 +01:00
import org.schabi.newpipe.extractor.linkhandler.ChannelTabs;
2022-10-25 21:13:16 +02:00
import org.schabi.newpipe.extractor.services.bandcamp.extractors.BandcampChannelTabExtractor;
import java.io.IOException;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.schabi.newpipe.extractor.ServiceList.Bandcamp;
import static org.schabi.newpipe.extractor.services.DefaultTests.defaultTestRelatedItems;
public class BandcampChannelTabExtractorTest {
public static class Albums {
private static BandcampChannelTabExtractor extractor;
@BeforeAll
public static void setUp() throws IOException, ExtractionException {
NewPipe.init(DownloaderTestImpl.getInstance());
extractor = (BandcampChannelTabExtractor) Bandcamp
2022-11-04 23:47:44 +01:00
.getChannelTabExtractorFromId("2450875064", ChannelTabs.ALBUMS);
2022-10-25 21:13:16 +02:00
extractor.fetchPage();
}
@Test
public void testServiceId() {
assertEquals(Bandcamp.getServiceId(), extractor.getServiceId());
}
@Test
public void testTab() {
2022-11-04 23:47:44 +01:00
assertEquals(ChannelTabs.ALBUMS, extractor.getTab());
2022-10-25 21:13:16 +02:00
}
@Test
public void testId() throws ParsingException {
assertEquals("2450875064", extractor.getId());
}
@Test
public void testUrl() throws ParsingException {
assertEquals("https://toupie.bandcamp.com/album", extractor.getUrl());
}
@Test
public void testRelatedItems() throws Exception {
defaultTestRelatedItems(extractor);
}
}
}