From 7b164b510a89feb81909204e3471df8306f96789 Mon Sep 17 00:00:00 2001 From: alpina0707 Date: Thu, 10 Feb 2022 17:22:05 +0100 Subject: [PATCH] bug fix renaming saved stations --- .../java/device/radioPlayer/RadioPlayer.java | 19 ++++++++++++++----- .../device/radioPlayer/RadioPlayerTest.java | 9 ++++++--- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/src/main/java/device/radioPlayer/RadioPlayer.java b/src/main/java/device/radioPlayer/RadioPlayer.java index fb31321..36d7170 100644 --- a/src/main/java/device/radioPlayer/RadioPlayer.java +++ b/src/main/java/device/radioPlayer/RadioPlayer.java @@ -8,9 +8,9 @@ public class RadioPlayer implements Device { public RadioPlayer() { super(); - Playlist.add("Radio YouFM"); - Playlist.add("Radio Teddy"); - Playlist.add("Radio MegaHits"); + Playlist.add("YouFM"); + Playlist.add("Teddy"); + Playlist.add("MegaHits"); playTrack=Playlist.get(0); } @@ -29,7 +29,7 @@ public class RadioPlayer implements Device { public void changeRegion(String region){ switch (region) { - case "Bayern": + case "BY": Playlist.clear(); Playlist.add("Antenne Bayern"); Playlist.add("Bayern 1"); @@ -37,7 +37,7 @@ public class RadioPlayer implements Device { Playlist.add("Hit Radio N1"); playTrack=Playlist.get(0); break; - case "Hessen": + case "HE": Playlist.clear(); Playlist.add("Hit Radio FFH"); Playlist.add("HR 1"); @@ -45,12 +45,21 @@ public class RadioPlayer implements Device { Playlist.add("You FM"); playTrack=Playlist.get(0); break; + case "BW": + Playlist.clear(); + Playlist.add("DASDING"); + Playlist.add("SWR 1"); + Playlist.add("SWR 3"); + Playlist.add("sunshine live"); + playTrack=Playlist.get(0); + break; default: Playlist.clear(); Playlist.add("YouFM"); Playlist.add("Teddy"); Playlist.add("MegaHits"); playTrack=Playlist.get(0); + break; } } diff --git a/src/test/java/device/radioPlayer/RadioPlayerTest.java b/src/test/java/device/radioPlayer/RadioPlayerTest.java index 6c173ae..89092ba 100644 --- a/src/test/java/device/radioPlayer/RadioPlayerTest.java +++ b/src/test/java/device/radioPlayer/RadioPlayerTest.java @@ -54,12 +54,15 @@ class RadioPlayerTest { static Stream changeRegionOptions() { RadioPlayer rp1 = new RadioPlayer(); RadioPlayer rp2 = new RadioPlayer(); - rp1.changeRegion("Bayern"); - rp2.changeRegion("Hessen"); + RadioPlayer rp3 = new RadioPlayer(); + rp1.changeRegion("BY"); + rp2.changeRegion("HE"); + rp3.changeRegion("BW"); return Stream.of( Arguments.of("Test change Region to Bayern", rp1, "Antenne Bayern"), - Arguments.of("Test change Region to Hessen", rp2, "Hit Radio FFH") + Arguments.of("Test change Region to Hessen", rp2, "Hit Radio FFH"), + Arguments.of("Test change Region to Baden-Wuerttemberg", rp3, "DASDING") ); }