|
| 1 | +package org.schabi.newpipe.extractor.services.youtube; |
| 2 | + |
| 3 | + |
| 4 | +/* |
| 5 | + * Created by Christian Schabesberger on 30.12.15. |
| 6 | + * |
| 7 | + * Copyright (C) Christian Schabesberger 2018 <chris.schabesberger@mailbox.org> |
| 8 | + * YoutubeStreamExtractorDonationTest.java is part of NewPipe. |
| 9 | + * |
| 10 | + * NewPipe is free software: you can redistribute it and/or modify |
| 11 | + * it under the terms of the GNU General Public License as published by |
| 12 | + * the Free Software Foundation, either version 3 of the License, or |
| 13 | + * (at your option) any later version. |
| 14 | + * |
| 15 | + * NewPipe is distributed in the hope that it will be useful, |
| 16 | + * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | + * GNU General Public License for more details. |
| 19 | + * |
| 20 | + * You should have received a copy of the GNU General Public License |
| 21 | + * along with NewPipe. If not, see <http://www.gnu.org/licenses/>. |
| 22 | + */ |
| 23 | + |
| 24 | +import org.junit.BeforeClass; |
| 25 | +import org.junit.Test; |
| 26 | +import org.schabi.newpipe.Downloader; |
| 27 | +import org.schabi.newpipe.extractor.NewPipe; |
| 28 | +import org.schabi.newpipe.extractor.stream.StreamExtractor; |
| 29 | + |
| 30 | +import static org.junit.Assert.assertTrue; |
| 31 | +import static org.schabi.newpipe.extractor.ServiceList.YouTube; |
| 32 | + |
| 33 | +/** |
| 34 | + * Test for {@link StreamExtractor} |
| 35 | + */ |
| 36 | +public class YoutubeStreamExtractorDonationTest { |
| 37 | + private static YoutubeStreamExtractor extractor; |
| 38 | + |
| 39 | + @BeforeClass |
| 40 | + public static void setUp() throws Exception { |
| 41 | + NewPipe.init(Downloader.getInstance()); |
| 42 | + extractor = (YoutubeStreamExtractor) YouTube |
| 43 | + .getStreamExtractor("https://www.youtube.com/watch?v=pXb3jERMoI0"); |
| 44 | + extractor.fetchPage(); |
| 45 | + } |
| 46 | + |
| 47 | + @Test |
| 48 | + public void getDonationLinksTest() throws Exception { |
| 49 | + assertTrue(String.valueOf(extractor.getDonationLinks().length), |
| 50 | + extractor.getDonationLinks().length == 2); |
| 51 | + } |
| 52 | +} |
0 commit comments