|
|
@ -320,4 +320,26 @@ class RadioPlayerTest { |
|
|
|
Arguments.of("Test for change order in saved playlist with nr is than smaller than 0 at front of playlist", rp2, 0, "Teddy") |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("getItemListOptions") |
|
|
|
void testGetItemList(String testName, RadioPlayer testRp, String testTyp, String[] expectedResult) { |
|
|
|
if (testTyp.equals("region")) { |
|
|
|
testRp.changeRegion("BY"); |
|
|
|
} |
|
|
|
|
|
|
|
String[] playList = testRp.getItemList(); |
|
|
|
assertThat(playList).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
} |
|
|
|
|
|
|
|
static Stream<Arguments> getItemListOptions() { |
|
|
|
RadioPlayer rp = new RadioPlayer(); |
|
|
|
RadioPlayer rp1 = new RadioPlayer(); |
|
|
|
rp1.changeRegion("BY"); |
|
|
|
|
|
|
|
return Stream.of( |
|
|
|
Arguments.of("Test for return saved playlist", rp, "saved", rp.savedPlaylist.toArray(new String[0])), |
|
|
|
Arguments.of("Test for return regional playlist", rp1, "region", rp1.regionPlaylist.toArray(new String[0])) |
|
|
|
); |
|
|
|
} |
|
|
|
} |