Refactored ``MediaCCCRecentListExtractorTest``
This commit is contained in:
parent
53962bfd7d
commit
26596215fa
|
@ -1,5 +1,11 @@
|
||||||
package org.schabi.newpipe.extractor.services.media_ccc;
|
package org.schabi.newpipe.extractor.services.media_ccc;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertAll;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
|
import static org.schabi.newpipe.extractor.ExtractorAsserts.assertGreater;
|
||||||
|
import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;
|
||||||
|
import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;
|
||||||
|
|
||||||
import org.junit.jupiter.api.BeforeAll;
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import org.junit.jupiter.api.function.Executable;
|
import org.junit.jupiter.api.function.Executable;
|
||||||
|
@ -8,15 +14,9 @@ import org.schabi.newpipe.extractor.NewPipe;
|
||||||
import org.schabi.newpipe.extractor.kiosk.KioskExtractor;
|
import org.schabi.newpipe.extractor.kiosk.KioskExtractor;
|
||||||
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
import org.schabi.newpipe.extractor.stream.StreamInfoItem;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
|
||||||
import java.util.stream.Stream;
|
import java.util.stream.Stream;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.*;
|
|
||||||
import static org.schabi.newpipe.extractor.ServiceList.MediaCCC;
|
|
||||||
import static org.schabi.newpipe.extractor.utils.Utils.isNullOrEmpty;
|
|
||||||
|
|
||||||
public class MediaCCCRecentListExtractorTest {
|
public class MediaCCCRecentListExtractorTest {
|
||||||
private static KioskExtractor extractor;
|
private static KioskExtractor extractor;
|
||||||
|
|
||||||
|
@ -37,9 +37,14 @@ public class MediaCCCRecentListExtractorTest {
|
||||||
|
|
||||||
private Stream<Executable> getAllConditionsForItem(final StreamInfoItem item) {
|
private Stream<Executable> getAllConditionsForItem(final StreamInfoItem item) {
|
||||||
return Stream.of(
|
return Stream.of(
|
||||||
() -> assertFalse(isNullOrEmpty(item.getName())),
|
() -> assertFalse(
|
||||||
() -> assertTrue(item.getDuration() > 0,
|
isNullOrEmpty(item.getName()),
|
||||||
"Duration[=" + item.getDuration() + "] of " + item + "is <= 0")
|
"Name=[" + item.getName() + "] of " + item + " is empty or null"
|
||||||
|
),
|
||||||
|
() -> assertGreater(0,
|
||||||
|
item.getDuration(),
|
||||||
|
"Duration[=" + item.getDuration() + "] of " + item + " is <= 0"
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue