Skip to content

Commit 39de55d

Browse files
committed
[YouTube] Fix and move streamCountTest
1 parent 51fd9ba commit 39de55d

2 files changed

Lines changed: 9 additions & 38 deletions

File tree

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/search/YoutubeSearchCountTest.java

Lines changed: 0 additions & 36 deletions
This file was deleted.

extractor/src/test/java/org/schabi/newpipe/extractor/services/youtube/search/YoutubeSearchExtractorChannelOnlyTest.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public void testGetSecondPage() throws Exception {
3939
boolean equals = true;
4040
for (int i = 0; i < secondPage.getItems().size()
4141
&& i < itemsPage.getItems().size(); i++) {
42-
if(!secondPage.getItems().get(i).getUrl().equals(
42+
if (!secondPage.getItems().get(i).getUrl().equals(
4343
itemsPage.getItems().get(i).getUrl())) {
4444
equals = false;
4545
}
@@ -58,7 +58,7 @@ public void testGetSecondPageUrl() throws Exception {
5858
@Test
5959
public void testOnlyContainChannels() {
6060
for(InfoItem item : itemsPage.getItems()) {
61-
if(!(item instanceof ChannelInfoItem)) {
61+
if (!(item instanceof ChannelInfoItem)) {
6262
fail("The following item is no channel item: " + item.toString());
6363
}
6464
}
@@ -78,4 +78,11 @@ public void testChannelUrl() {
7878
}
7979
}
8080
}
81+
82+
@Test
83+
public void testStreamCount() {
84+
ChannelInfoItem ci = (ChannelInfoItem) itemsPage.getItems().get(0);
85+
assertTrue("Stream count does not fit: " + ci.getStreamCount(),
86+
4000 < ci.getStreamCount() && ci.getStreamCount() < 5500);
87+
}
8188
}

0 commit comments

Comments
 (0)