|
|
@ -44,35 +44,30 @@ class RadioPlayerTest { |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
/* |
|
|
|
@Test |
|
|
|
void louder() { |
|
|
|
rp.setLautstaerke(0); |
|
|
|
rp.louder(); |
|
|
|
assertThat(rp.getLautstaerke()).isEqualTo(1); |
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("changeRegionOptions") |
|
|
|
void changeRegionTest(String testName, RadioPlayer testRp, String expectedResult) { |
|
|
|
String station = testRp.playTrack; |
|
|
|
assertThat(station).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
void louderMax() { |
|
|
|
rp.setLautstaerke(100); |
|
|
|
rp.louder(); |
|
|
|
assertThat(rp.getLautstaerke()).isEqualTo(100); |
|
|
|
} |
|
|
|
static Stream<Arguments> changeRegionOptions() { |
|
|
|
RadioPlayer rp1 = new RadioPlayer(); |
|
|
|
RadioPlayer rp2 = new RadioPlayer(); |
|
|
|
RadioPlayer rp3 = new RadioPlayer(); |
|
|
|
rp1.changeRegion("BY"); |
|
|
|
rp2.changeRegion("HE"); |
|
|
|
rp3.changeRegion("BW"); |
|
|
|
|
|
|
|
@Test |
|
|
|
void quieter() { |
|
|
|
rp.setLautstaerke(1); |
|
|
|
rp.quieter(); |
|
|
|
assertThat(rp.getLautstaerke()).isEqualTo(0); |
|
|
|
} |
|
|
|
@Test |
|
|
|
void quieterMax() { |
|
|
|
rp.setLautstaerke(0); |
|
|
|
rp.quieter(); |
|
|
|
assertThat(rp.getLautstaerke()).isEqualTo(0); |
|
|
|
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 Baden-Wuerttemberg", rp3, "DASDING") |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
Jenkins config test |
|
|
|
|
|
|
|
/* |
|
|
|
@Test |
|
|
|
void getVolume() { |
|
|
|
} |
|
|
@ -94,9 +89,9 @@ class RadioPlayerTest { |
|
|
|
rp2.prev(); |
|
|
|
rp3.prev(); |
|
|
|
return Stream.of( |
|
|
|
Arguments.of("Next Station Test", rp1, "Radio Teddy"), |
|
|
|
Arguments.of("Prev Station Test", rp2, "Radio YouFM"), |
|
|
|
Arguments.of("Prev works on first Station ", rp3, "Radio MegaHits") |
|
|
|
Arguments.of("Next Station Test", rp1, "Teddy"), |
|
|
|
Arguments.of("Prev Station Test", rp2, "YouFM"), |
|
|
|
Arguments.of("Prev works on first Station ", rp3, "MegaHits") |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|