Browse Source

added dynamic station search & time to showStationInfo() & second test case

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

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

@ -157,6 +157,14 @@ public class RadioPlayer implements Device {
} }
public String showStationInfo() { public String showStationInfo() {
switch (playTrack) {
case "Antenne Bayern":
return getAntenneBYInfoByTime(hour);
case "YouFM":
return getYouFMInfoByTime(hour); return getYouFMInfoByTime(hour);
default: return "";
}
} }
} }

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

@ -140,9 +140,12 @@ class RadioPlayerTest {
static Stream<Arguments> showStationInfoOptions() { static Stream<Arguments> showStationInfoOptions() {
RadioPlayer rp1 = new RadioPlayer(); RadioPlayer rp1 = new RadioPlayer();
RadioPlayer rp2 = new RadioPlayer();
rp2.changeRegion("BY");
return Stream.of( return Stream.of(
Arguments.of("Show Station Info for first saved Radio", rp1, rp1.getYouFMInfoByTime(rp1.hour))
Arguments.of("Show Station Info for first saved Radio", rp1, rp1.getYouFMInfoByTime(rp1.hour)),
Arguments.of("Show Station Info for regional Station", rp2, rp2.getAntenneBYInfoByTime(rp2.hour))
); );
} }

Loading…
Cancel
Save