Browse Source

UsbPlayerTest.unmuteTest second Case

feature-pr-USB-otherTests
sahar 3 years ago
parent
commit
a7c3ea8610
  1. 1
      src/main/java/device/usbPlayer/UsbPlayer.java
  2. 9
      src/test/java/device/usbPlayer/UsbPlayerTest.java

1
src/main/java/device/usbPlayer/UsbPlayer.java

@ -192,6 +192,7 @@ public class UsbPlayer implements Device {
@Override
public String unmute() {
setLautstaerke(soundWas);
return "unmuted";
}

9
src/test/java/device/usbPlayer/UsbPlayerTest.java

@ -458,22 +458,23 @@ class UsbPlayerTest {
@ParameterizedTest
@MethodSource("unmuteOptions")
void unmuteTest(String testName, UsbPlayer inputUSB, String expectedResult) {
void unmuteTest(String testName, UsbPlayer inputUSB, String expectedResult,String testName2) {
int prevSound = inputUSB.getLautstaerke();
String unMuted = inputUSB.unmute();
//first case
assertThat(unMuted).describedAs(testName).isEqualTo(expectedResult);
//Second case
assertThat(inputUSB.getLautstaerke()).describedAs(testName2).isEqualTo(prevSound);
}
static Stream<Arguments> unmuteOptions() {
USB_Stick USBDrive = new USB_Stick();
UsbPlayer up1 = new UsbPlayer(USBDrive);
up1.unmute();
return Stream.of(
Arguments.of("The Sound is unmuted ", up1,"unmuted")
Arguments.of("The Sound is unmuted ", up1,"unmuted","Sound level has changed")
);
}

Loading…
Cancel
Save