Browse Source

added productive Code for louder if volume is max

feature-pr-revised_louderQuieter
Jan Ortner 3 years ago
parent
commit
43854c18e5
  1. 4
      src/main/java/device/radioPlayer/RadioPlayer.java
  2. 4
      src/test/java/device/radioPlayer/RadioPlayerTest.java

4
src/main/java/device/radioPlayer/RadioPlayer.java

@ -29,7 +29,9 @@ public class RadioPlayer implements Device {
@Override @Override
public void louder() { public void louder() {
Lautstaerke+=1;
if(Lautstaerke < 100){
Lautstaerke+=1;}
else Lautstaerke = 100;
} }
@Override @Override

4
src/test/java/device/radioPlayer/RadioPlayerTest.java

@ -31,8 +31,8 @@ class RadioPlayerTest {
rp2.setLautstaerke(100); rp2.setLautstaerke(100);
rp2.louder(); rp2.louder();
return Stream.of( return Stream.of(
Arguments.of("Test for one louder", rp1, 1),
Arguments.of("Test for one louder", rp2, 100)
Arguments.of("Test for one step louder", rp1, 1),
Arguments.of("Test for max louder", rp2, 100)
); );
} }

Loading…
Cancel
Save