|
| 1 | +package org.schabi.newpipe.extractor.services.media_ccc; |
| 2 | + |
| 3 | +import static org.junit.jupiter.api.Assertions.assertEquals; |
| 4 | +import static org.schabi.newpipe.extractor.ServiceList.MediaCCC; |
| 5 | + |
| 6 | +import org.junit.jupiter.api.BeforeAll; |
| 7 | +import org.junit.jupiter.api.Test; |
| 8 | +import org.schabi.newpipe.downloader.DownloaderTestImpl; |
| 9 | +import org.schabi.newpipe.extractor.NewPipe; |
| 10 | +import org.schabi.newpipe.extractor.channel.tabs.ChannelTabExtractor; |
| 11 | +import org.schabi.newpipe.extractor.channel.tabs.ChannelTabs; |
| 12 | + |
| 13 | +/** |
| 14 | + * Test that it is possible to create and use a channel tab extractor ({@link |
| 15 | + * org.schabi.newpipe.extractor.services.media_ccc.extractors.MediaCCCChannelTabExtractor}) without |
| 16 | + * passing through the conference extractor |
| 17 | + */ |
| 18 | +public class MediaCCCChannelTabExtractorTest { |
| 19 | + public static class CCCamp2023 { |
| 20 | + private static ChannelTabExtractor extractor; |
| 21 | + |
| 22 | + @BeforeAll |
| 23 | + public static void setUpClass() throws Exception { |
| 24 | + NewPipe.init(DownloaderTestImpl.getInstance()); |
| 25 | + extractor = MediaCCC.getChannelTabExtractorFromId("camp2023", ChannelTabs.VIDEOS); |
| 26 | + extractor.fetchPage(); |
| 27 | + } |
| 28 | + |
| 29 | + @Test |
| 30 | + void testName() { |
| 31 | + assertEquals(ChannelTabs.VIDEOS, extractor.getName()); |
| 32 | + } |
| 33 | + |
| 34 | + @Test |
| 35 | + void testGetUrl() throws Exception { |
| 36 | + assertEquals("https://media.ccc.de/c/camp2023", extractor.getUrl()); |
| 37 | + } |
| 38 | + |
| 39 | + @Test |
| 40 | + void testGetOriginalUrl() throws Exception { |
| 41 | + assertEquals("https://media.ccc.de/c/camp2023", extractor.getOriginalUrl()); |
| 42 | + } |
| 43 | + |
| 44 | + @Test |
| 45 | + void testGetInitalPage() throws Exception { |
| 46 | + assertEquals(177, extractor.getInitialPage().getItems().size()); |
| 47 | + } |
| 48 | + } |
| 49 | +} |
0 commit comments