From 966541c2e2b67e442df614deca81f5becb77393d Mon Sep 17 00:00:00 2001 From: alpina0707 Date: Thu, 10 Feb 2022 22:06:18 +0100 Subject: [PATCH] added Test for station without Info text --- src/main/java/device/radioPlayer/RadioPlayer.java | 4 ++-- src/test/java/device/radioPlayer/RadioPlayerTest.java | 5 ++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/device/radioPlayer/RadioPlayer.java b/src/main/java/device/radioPlayer/RadioPlayer.java index 5d771c6..25aba84 100644 --- a/src/main/java/device/radioPlayer/RadioPlayer.java +++ b/src/main/java/device/radioPlayer/RadioPlayer.java @@ -40,8 +40,8 @@ public class RadioPlayer implements Device { else if (x >= 13 && x < 16) return BR3Info[3]; else if (x >= 16 && x < 19) return BR3Info[4]; else if (x >= 19 && x < 21) return BR3Info[5]; - else if (x >= 22 && x <= 23) return BR3Info[5]; - else return BR3Info[6]; + else if (x >= 22 && x <= 23) return BR3Info[6]; + else return BR3Info[7]; } String[] BR3Info = {"Sebastian Winkler und die Frühaufdreher", "BAYERN 3 - und DU mittendrin!", "Update", "Hits, Hits, Hits für euren Nachmittag", "Die Zwei für euren Feierabend", "Was geht?!", "Matuschke - der etwas andere Abend","Die Nacht"}; diff --git a/src/test/java/device/radioPlayer/RadioPlayerTest.java b/src/test/java/device/radioPlayer/RadioPlayerTest.java index 5581857..7829715 100644 --- a/src/test/java/device/radioPlayer/RadioPlayerTest.java +++ b/src/test/java/device/radioPlayer/RadioPlayerTest.java @@ -146,11 +146,14 @@ class RadioPlayerTest { rp3.changeRegion("BY"); rp3.next(); rp3.next(); + RadioPlayer rp4 = new RadioPlayer(); + rp4.next(); return Stream.of( 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)), - Arguments.of("Test for getting info text after station switching ", rp3, rp1.getBR3InfoByTime(rp3.hour)) + Arguments.of("Test for getting info text after station switching ", rp3, rp1.getBR3InfoByTime(rp3.hour)), + Arguments.of("Show info text for a station without ", rp4, "") ); }