|
|
@ -377,17 +377,21 @@ class RadioPlayerTest { |
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("getInfoTextOptions") |
|
|
|
void testGetInfoText(String testName, RadioPlayer testRp, boolean expectedResult) { |
|
|
|
Boolean volume = Strings.isNullOrEmpty(testRp.getInfoText()); |
|
|
|
void testGetInfoText(String testName, String testTyp, RadioPlayer testRp, boolean expectedResult) { |
|
|
|
Boolean bool; |
|
|
|
if(testTyp.equals("null")) bool = Strings.isNullOrEmpty(testRp.getInfoText()); |
|
|
|
else bool = testRp.getInfoText().contains(testRp.playedStation); |
|
|
|
|
|
|
|
assertThat(volume).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
assertThat(bool).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
} |
|
|
|
|
|
|
|
static Stream<Arguments> getInfoTextOptions() { |
|
|
|
RadioPlayer rp = new RadioPlayer(); |
|
|
|
RadioPlayer rp1 = new RadioPlayer(); |
|
|
|
|
|
|
|
return Stream.of( |
|
|
|
Arguments.of("Test for getInfoText is not empty or null", rp, false) |
|
|
|
Arguments.of("Test for getInfoText is not empty or null", "null", rp, false), |
|
|
|
Arguments.of("Test for getInfoText contains played station", "station", rp1, true) |
|
|
|
); |
|
|
|
} |
|
|
|
} |