|
@ -16,7 +16,23 @@ class RadioPlayerTest { |
|
|
|
|
|
|
|
|
RadioPlayer rp = new RadioPlayer(); |
|
|
RadioPlayer rp = new RadioPlayer(); |
|
|
|
|
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
|
|
@MethodSource("quieterLouderOptions") |
|
|
|
|
|
void quieterLouderTest(String testName, RadioPlayer testRp, int expectedResult) { |
|
|
|
|
|
int volume = testRp.getLautstaerke(); |
|
|
|
|
|
assertThat(volume).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
static Stream<Arguments> quieterLouderOptions() { |
|
|
|
|
|
RadioPlayer rp1 = new RadioPlayer(); |
|
|
|
|
|
rp1.setLautstaerke(0); |
|
|
|
|
|
rp1.louder(); |
|
|
|
|
|
return Stream.of( |
|
|
|
|
|
Arguments.of("Test for one louder", rp1, 1) |
|
|
|
|
|
); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/* |
|
|
@Test |
|
|
@Test |
|
|
void louder() { |
|
|
void louder() { |
|
|
rp.setLautstaerke(0); |
|
|
rp.setLautstaerke(0); |
|
@ -43,7 +59,7 @@ class RadioPlayerTest { |
|
|
rp.quieter(); |
|
|
rp.quieter(); |
|
|
assertThat(rp.getLautstaerke()).isEqualTo(0); |
|
|
assertThat(rp.getLautstaerke()).isEqualTo(0); |
|
|
} |
|
|
} |
|
|
/* |
|
|
|
|
|
|
|
|
|
|
|
Jenkins config test |
|
|
Jenkins config test |
|
|
@Test |
|
|
@Test |
|
|
void getVolume() { |
|
|
void getVolume() { |
|
|