diff --git a/src/main/java/device/radioPlayer/RadioPlayer.java b/src/main/java/device/radioPlayer/RadioPlayer.java index b199256..9f928a1 100644 --- a/src/main/java/device/radioPlayer/RadioPlayer.java +++ b/src/main/java/device/radioPlayer/RadioPlayer.java @@ -83,7 +83,7 @@ public class RadioPlayer implements Device { Playlist.add("Hit Radio FFH"); Playlist.add("HR 1"); Playlist.add("HR 3"); - Playlist.add("You FM"); + Playlist.add("YouFM"); playTrack=Playlist.get(0); break; case "BW": @@ -157,6 +157,14 @@ public class RadioPlayer implements Device { } public String showStationInfo() { - return getYouFMInfoByTime(hour); + switch (playTrack) { + case "Antenne Bayern": + return getAntenneBYInfoByTime(hour); + case "YouFM": + return getYouFMInfoByTime(hour); + default: return ""; + } + + } } diff --git a/src/test/java/device/radioPlayer/RadioPlayerTest.java b/src/test/java/device/radioPlayer/RadioPlayerTest.java index 5b948f3..2861364 100644 --- a/src/test/java/device/radioPlayer/RadioPlayerTest.java +++ b/src/test/java/device/radioPlayer/RadioPlayerTest.java @@ -140,9 +140,12 @@ class RadioPlayerTest { static Stream showStationInfoOptions() { RadioPlayer rp1 = new RadioPlayer(); + RadioPlayer rp2 = new RadioPlayer(); + rp2.changeRegion("BY"); 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)) ); }