|
@ -345,9 +345,10 @@ class RadioPlayerTest { |
|
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
@ParameterizedTest |
|
|
@MethodSource("muteOptions") |
|
|
@MethodSource("muteOptions") |
|
|
void testMute(String testName, RadioPlayer testRp, int expectedResult) { |
|
|
|
|
|
|
|
|
|
|
|
int volume = testRp.getVolume(); |
|
|
|
|
|
|
|
|
void testMute(String testName, String testTyp, RadioPlayer testRp, int expectedResult) { |
|
|
|
|
|
int volume; |
|
|
|
|
|
if (testTyp.equals("actual")) volume = testRp.getVolume(); |
|
|
|
|
|
else volume = testRp.savedVolume; |
|
|
assertThat(volume).describedAs(testName).isEqualTo(expectedResult); |
|
|
assertThat(volume).describedAs(testName).isEqualTo(expectedResult); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -355,9 +356,13 @@ class RadioPlayerTest { |
|
|
RadioPlayer rp = new RadioPlayer(); |
|
|
RadioPlayer rp = new RadioPlayer(); |
|
|
rp.setLautstaerke(25); |
|
|
rp.setLautstaerke(25); |
|
|
rp.mute(); |
|
|
rp.mute(); |
|
|
|
|
|
RadioPlayer rp1 = new RadioPlayer(); |
|
|
|
|
|
rp1.setLautstaerke(30); |
|
|
|
|
|
rp1.mute(); |
|
|
|
|
|
|
|
|
return Stream.of( |
|
|
return Stream.of( |
|
|
Arguments.of("Test for mute RadioPlayer if volume is actually 0", rp, 0) |
|
|
|
|
|
|
|
|
Arguments.of("Test for mute RadioPlayer if volume is actually 0", "actual", rp, 0), |
|
|
|
|
|
Arguments.of("Test for mute RadioPlayer if volume is saved before muting", "saved", rp1, 30) |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |