From 089fa0144fc4cee135db2b69a6ec138c1902d440 Mon Sep 17 00:00:00 2001 From: alpina0707 Date: Thu, 17 Feb 2022 02:07:22 +0100 Subject: [PATCH] revised test for RadioPlayer getBR3InfoByTime() --- .../device/radioPlayer/RadioPlayerTest.java | 21 +++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/test/java/device/radioPlayer/RadioPlayerTest.java b/src/test/java/device/radioPlayer/RadioPlayerTest.java index 51a85cf..d409765 100644 --- a/src/test/java/device/radioPlayer/RadioPlayerTest.java +++ b/src/test/java/device/radioPlayer/RadioPlayerTest.java @@ -105,18 +105,27 @@ class RadioPlayerTest { @MethodSource("infoByTimeOptions") void infoByTimeInfo(String testName, RadioPlayer testRp, String testTyp, int hour, String expectedResult) { if(testTyp.equals("YouFm")) assertThat(testRp.getYouFMInfoByTime(hour)).describedAs(testName).isEqualTo(expectedResult); + if(testTyp.equals("BR3")) assertThat(testRp.getBR3InfoByTime(hour)).describedAs(testName).isEqualTo(expectedResult); } static Stream infoByTimeOptions() { RadioPlayer rp = new RadioPlayer(); return Stream.of( Arguments.of("Station info YouFm at 5:00 am", rp, "YouFM", 5, rp.YouFMInfo[0]), - Arguments.of("Station info YouFm at 5:00 am", rp, "YouFM", 10, rp.YouFMInfo[1]), - Arguments.of("Station info YouFm at 5:00 am", rp, "YouFM", 14, rp.YouFMInfo[2]), - Arguments.of("Station info YouFm at 5:00 am", rp, "YouFM", 18, rp.YouFMInfo[3]), - Arguments.of("Station info YouFm at 5:00 am", rp, "YouFM", 20, rp.YouFMInfo[4]), - Arguments.of("Station info YouFm at 5:00 am", rp, "YouFM", 22, rp.YouFMInfo[5]), - Arguments.of("Station info YouFm at 5:00 am", rp, "YouFM", 3, rp.YouFMInfo[6]) + Arguments.of("Station info YouFm at 10:00 am", rp, "YouFM", 10, rp.YouFMInfo[1]), + Arguments.of("Station info YouFm at 2:00 pm", rp, "YouFM", 14, rp.YouFMInfo[2]), + Arguments.of("Station info YouFm at 6:00 pm", rp, "YouFM", 18, rp.YouFMInfo[3]), + Arguments.of("Station info YouFm at 8:00 pm", rp, "YouFM", 20, rp.YouFMInfo[4]), + Arguments.of("Station info YouFm at 10:00 pm", rp, "YouFM", 22, rp.YouFMInfo[5]), + Arguments.of("Station info YouFm at 3:00 am", rp, "YouFM", 3, rp.YouFMInfo[6]), + Arguments.of("Station info BR3 at 5:00 am", rp, "BR3", 5, rp.BR3Info[0]), + Arguments.of("Station info BR3 at 9:00 am", rp, "BR3", 9, rp.BR3Info[1]), + Arguments.of("Station info BR3 at 12:00 am", rp, "BR3", 12, rp.BR3Info[2]), + Arguments.of("Station info BR3 at 1:00 pm", rp, "BR3", 13, rp.BR3Info[3]), + Arguments.of("Station info BR3 at 4:00 pm", rp, "BR3", 16, rp.BR3Info[4]), + Arguments.of("Station info BR3 at 7:00 pm", rp, "BR3", 19, rp.BR3Info[5]), + Arguments.of("Station info BR3 at 9:00 pm", rp, "BR3", 21, rp.BR3Info[6]), + Arguments.of("Station info BR3 at 3:00 am", rp, "BR3", 3, rp.BR3Info[7]) ); }