Browse Source

added showStationInfo() & first test case

feature-pr-getVolume
Jan Ortner 3 years ago
parent
commit
64d70c3921
  1. 4
      src/main/java/device/radioPlayer/RadioPlayer.java
  2. 14
      src/test/java/device/radioPlayer/RadioPlayerTest.java

4
src/main/java/device/radioPlayer/RadioPlayer.java

@ -155,4 +155,8 @@ public class RadioPlayer implements Device {
public String play() {
return null;
}
public String showStationInfo() {
return getYouFMInfoByTime(hour);
}
}

14
src/test/java/device/radioPlayer/RadioPlayerTest.java

@ -131,6 +131,20 @@ class RadioPlayerTest {
assertThat(rp.getBR3InfoByTime(21)).describedAs("BR3 info by Time at 21.00").isEqualTo("Matuschke - der etwas andere Abend");
}
@ParameterizedTest
@MethodSource("showStationInfoOptions")
void showStationInfo(String testName, RadioPlayer testRp, String expectedResult) {
String info = testRp.showStationInfo();
assertThat(info).describedAs(testName).isEqualTo(expectedResult);
}
static Stream<Arguments> showStationInfoOptions() {
RadioPlayer rp1 = new RadioPlayer();
return Stream.of(
Arguments.of("Show Station Info for first saved Radio", rp1, rp1.getYouFMInfoByTime(rp1.hour))
);
}
/*

Loading…
Cancel
Save