diff --git a/src/main/java/device/radioPlayer/RadioPlayer.java b/src/main/java/device/radioPlayer/RadioPlayer.java index 2129b6b..44621be 100644 --- a/src/main/java/device/radioPlayer/RadioPlayer.java +++ b/src/main/java/device/radioPlayer/RadioPlayer.java @@ -151,7 +151,7 @@ public class RadioPlayer implements Device { public String getInfoText() { String infoText = playedStation; if(regionPlaylist.contains(playedStation)) return ("Regional playlist " + infoText); - else return infoText; + else return ("Saved playlist " + infoText); } @Override diff --git a/src/test/java/device/radioPlayer/RadioPlayerTest.java b/src/test/java/device/radioPlayer/RadioPlayerTest.java index f127ab9..f49390e 100644 --- a/src/test/java/device/radioPlayer/RadioPlayerTest.java +++ b/src/test/java/device/radioPlayer/RadioPlayerTest.java @@ -382,6 +382,7 @@ class RadioPlayerTest { if(testTyp.equals("null")) bool = Strings.isNullOrEmpty(testRp.getInfoText()); else if(testTyp.contains("station")) bool = testRp.getInfoText().contains(testRp.playedStation); else if(testTyp.contains("region")) bool = testRp.getInfoText().contains("Regional playlist"); + else if(testTyp.contains("saved")) bool = testRp.getInfoText().contains("Saved playlist"); assertThat(bool).describedAs(testName).isEqualTo(expectedResult); } @@ -391,11 +392,13 @@ class RadioPlayerTest { RadioPlayer rp1 = new RadioPlayer(); RadioPlayer rp2 = new RadioPlayer(); rp2.changeRegion("BY"); + RadioPlayer rp3 = new RadioPlayer(); return Stream.of( Arguments.of("Test for getInfoText is not empty or null", "null", rp, false), Arguments.of("Test for getInfoText contains played station", "station", rp1, true), - Arguments.of("Test for getInfoText contains regional playlist if played station is in it", "region", rp2, true) + Arguments.of("Test for getInfoText contains regional playlist if played station is in it", "region", rp2, true), + Arguments.of("Test for getInfoText contains saved playlist if played station is in it", "saved", rp3, true) ); } } \ No newline at end of file