Browse Source

UsbPlayerTest.louder_10_Test() first Case

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

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

@ -104,6 +104,10 @@ public class UsbPlayer implements Device {
}
}
public void Louder_10(){
Lautstaerke += 10;
}
@Override
public int getVolume() {
return 0;

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

@ -114,7 +114,6 @@ void louderTest(String testName, UsbPlayer inputPlay, int expectedResult) {
);
}
////////////////
@ParameterizedTest
@MethodSource("PrevOptions")
void PrevTest(String testName, UsbPlayer inputPlay, String expectedResult) {
@ -137,4 +136,20 @@ void louderTest(String testName, UsbPlayer inputPlay, int expectedResult) {
);
}
@ParameterizedTest
@MethodSource("louder_10_Options")
void louder_10_Test(String testName, UsbPlayer inputPlay, int expectedResult) {
int volumeNum = inputPlay.getLautstaerke();
assertThat(volumeNum).describedAs(testName).isEqualTo(expectedResult);
}
static Stream<Arguments> louder_10_Options() {
UsbPlayer up1 = new UsbPlayer();
up1.Louder_10();
return Stream.of(
Arguments.of("Volume was 0, should 10 ", up1, 10)
);
}
}
Loading…
Cancel
Save