Browse Source

revised test for RadioPlayer getAntenneBYInfoByTime()

feature-pr-cdPlayer-showStationInfo
Jan Ortner 3 years ago
parent
commit
5885370fe3
  1. 10
      src/test/java/device/radioPlayer/RadioPlayerTest.java

10
src/test/java/device/radioPlayer/RadioPlayerTest.java

@ -104,8 +104,9 @@ class RadioPlayerTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("infoByTimeOptions") @MethodSource("infoByTimeOptions")
void infoByTimeInfo(String testName, RadioPlayer testRp, String testTyp, int hour, String expectedResult) { 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("YouFM")) assertThat(testRp.getYouFMInfoByTime(hour)).describedAs(testName).isEqualTo(expectedResult);
if(testTyp.equals("BR3")) assertThat(testRp.getBR3InfoByTime(hour)).describedAs(testName).isEqualTo(expectedResult); if(testTyp.equals("BR3")) assertThat(testRp.getBR3InfoByTime(hour)).describedAs(testName).isEqualTo(expectedResult);
if(testTyp.equals("AntenneBY")) assertThat(testRp.getAntenneBYInfoByTime(hour)).describedAs(testName).isEqualTo(expectedResult);
} }
static Stream<Arguments> infoByTimeOptions() { static Stream<Arguments> infoByTimeOptions() {
@ -125,7 +126,12 @@ class RadioPlayerTest {
Arguments.of("Station info BR3 at 4:00 pm", rp, "BR3", 16, rp.BR3Info[4]), 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 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 9:00 pm", rp, "BR3", 21, rp.BR3Info[6]),
Arguments.of("Station info BR3 at 3:00 am", rp, "BR3", 3, rp.BR3Info[7])
Arguments.of("Station info BR3 at 3:00 am", rp, "BR3", 3, rp.BR3Info[7]),
Arguments.of("Station info AntenneBY at 5:00 am", rp, "AntenneBY", 5, rp.AntenneBYInfo[0]),
Arguments.of("Station info AntenneBY at 9:00 am", rp, "AntenneBY", 9, rp.AntenneBYInfo[1]),
Arguments.of("Station info AntenneBY at 12:00 am", rp, "AntenneBY", 12, rp.AntenneBYInfo[2]),
Arguments.of("Station info AntenneBY at 3:00 pm", rp, "AntenneBY", 15, rp.AntenneBYInfo[3]),
Arguments.of("Station info AntenneBY at 3:00 am", rp, "AntenneBY", 3, rp.AntenneBYInfo[4])
); );
} }

Loading…
Cancel
Save