|
|
@ -378,9 +378,10 @@ class RadioPlayerTest { |
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("getInfoTextOptions") |
|
|
|
void testGetInfoText(String testName, String testTyp, RadioPlayer testRp, boolean expectedResult) { |
|
|
|
Boolean bool; |
|
|
|
Boolean bool = null; |
|
|
|
if(testTyp.equals("null")) bool = Strings.isNullOrEmpty(testRp.getInfoText()); |
|
|
|
else bool = testRp.getInfoText().contains(testRp.playedStation); |
|
|
|
else if(testTyp.contains("station")) bool = testRp.getInfoText().contains(testRp.playedStation); |
|
|
|
else if(testTyp.contains("region")) bool = testRp.getInfoText().contains("Regional playlist"); |
|
|
|
|
|
|
|
assertThat(bool).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
} |
|
|
@ -388,10 +389,13 @@ class RadioPlayerTest { |
|
|
|
static Stream<Arguments> getInfoTextOptions() { |
|
|
|
RadioPlayer rp = new RadioPlayer(); |
|
|
|
RadioPlayer rp1 = new RadioPlayer(); |
|
|
|
RadioPlayer rp2 = new RadioPlayer(); |
|
|
|
rp2.changeRegion("BY"); |
|
|
|
|
|
|
|
return Stream.of( |
|
|
|
Arguments.of("Test for getInfoText is not empty or null", "null", rp, false), |
|
|
|
Arguments.of("Test for getInfoText contains played station", "station", rp1, true) |
|
|
|
Arguments.of("Test for getInfoText contains played station", "station", rp1, true), |
|
|
|
Arguments.of("Test for getInfoText contains regional playlist if played station is in it", "region", rp2, true) |
|
|
|
); |
|
|
|
} |
|
|
|
} |