Browse Source

UsbPlayerTest.quieter_10_Test third Case

feature-pr-USB-10Louder
sahar 3 years ago
parent
commit
3d34b2c239
  1. 3
      src/main/java/device/usbPlayer/UsbPlayer.java
  2. 5
      src/test/java/device/usbPlayer/UsbPlayerTest.java

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

@ -113,6 +113,9 @@ public class UsbPlayer implements Device {
public void quieter_10(){
Lautstaerke -= 10;
if (Lautstaerke < 0) {
Lautstaerke = 0;
}
}
@Override

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

@ -180,10 +180,13 @@ void louderTest(String testName, UsbPlayer inputPlay, int expectedResult) {
up2.quieter_10();
}
UsbPlayer up3 = new UsbPlayer();
up3.quieter_10();
return Stream.of(
Arguments.of("Volume was 10, should be 0 ", up1, 0),
Arguments.of("Volume was 50, should be 20 ", up2, 20)
Arguments.of("Volume was 50, should be 20 ", up2, 20),
Arguments.of("Volume was 0, should stay 0 ", up3, 0)
);
}
Loading…
Cancel
Save