|
|
@ -244,4 +244,25 @@ class RadioPlayerTest { |
|
|
|
Arguments.of("Test for not delete station in saved playlist if this is the last station", rp1, "noDelete", true) |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("changeToSavedPlaylistOptions") |
|
|
|
void testChangeToSavedPlaylist(String testName, RadioPlayer testRp, String expectedResult) { |
|
|
|
String savedStation = testRp.playedStation; |
|
|
|
assertThat(savedStation).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
} |
|
|
|
|
|
|
|
static Stream<Arguments> changeToSavedPlaylistOptions() { |
|
|
|
RadioPlayer rp = new RadioPlayer(); |
|
|
|
rp.changeToSavedPlaylist(); |
|
|
|
RadioPlayer rp1 = new RadioPlayer(); |
|
|
|
rp1.changeRegion("BY"); |
|
|
|
rp1.changeToSavedPlaylist(); |
|
|
|
|
|
|
|
return Stream.of( |
|
|
|
Arguments.of("Test for change to saved playlist when you already in saved playlist", rp, "YouFM"), |
|
|
|
Arguments.of("Test for change to saved playlist when in regional playlist", rp1, "YouFM") |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
} |