|
|
@ -429,6 +429,31 @@ class UsbPlayerTest { |
|
|
|
Arguments.of("USB Player with Albums ", up1,"USB Player is on : "+up1.getPlayTrack()), |
|
|
|
Arguments.of("USB Player with no Albums ", up2,"USB Player with no Albums") |
|
|
|
); |
|
|
|
}//"muted" |
|
|
|
|
|
|
|
@ParameterizedTest |
|
|
|
@MethodSource("muteOptions") |
|
|
|
void muteTest(String testName, UsbPlayer inputUSB, String expectedResult,String testName2) { |
|
|
|
|
|
|
|
String isMuted = inputUSB.mute(); |
|
|
|
assertThat(isMuted).describedAs(testName).isEqualTo(expectedResult); |
|
|
|
//Second case |
|
|
|
assertThat(inputUSB.getLautstaerke()).describedAs(testName2).isEqualTo(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
static Stream<Arguments> muteOptions() { |
|
|
|
USB_Stick USBDrive = new USB_Stick(); |
|
|
|
|
|
|
|
//first case |
|
|
|
UsbPlayer up1 = new UsbPlayer(USBDrive); |
|
|
|
up1.mute(); |
|
|
|
|
|
|
|
|
|
|
|
return Stream.of( |
|
|
|
Arguments.of("The Sound is muted ", up1,"muted","Sound level is 0") |
|
|
|
|
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
|
} |