Browse Source

UsbPlayerTest.muteTest third Case

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

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

@ -184,7 +184,7 @@ public class UsbPlayer implements Device {
@Override
public String mute() {
this.soundWas = getLautstaerke();
setLautstaerke(0);
return "muted";
}

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

@ -433,12 +433,14 @@ class UsbPlayerTest {
@ParameterizedTest
@MethodSource("muteOptions")
void muteTest(String testName, UsbPlayer inputUSB, String expectedResult,String testName2) {
void muteTest(String testName, UsbPlayer inputUSB, String expectedResult,String testName2,String testName3) {
int prevSound = inputUSB.getLautstaerke();
String isMuted = inputUSB.mute();
assertThat(isMuted).describedAs(testName).isEqualTo(expectedResult);
//Second case
assertThat(inputUSB.getLautstaerke()).describedAs(testName2).isEqualTo(0);
//third case
assertThat(inputUSB.soundWas).describedAs(testName3).isEqualTo(prevSound);
}
@ -451,7 +453,7 @@ class UsbPlayerTest {
return Stream.of(
Arguments.of("The Sound is muted ", up1,"muted","Sound level is 0")
Arguments.of("The Sound is muted ", up1,"muted","Sound level is 0","previous sound level is saved ")
);
}

Loading…
Cancel
Save