diff --git a/src/main/java/device/radioPlayer/RadioPlayer.java b/src/main/java/device/radioPlayer/RadioPlayer.java index f3b6b04..d731482 100644 --- a/src/main/java/device/radioPlayer/RadioPlayer.java +++ b/src/main/java/device/radioPlayer/RadioPlayer.java @@ -29,7 +29,9 @@ public class RadioPlayer implements Device { @Override public void louder() { - Lautstaerke+=1; + if(Lautstaerke < 100){ + Lautstaerke+=1;} + else Lautstaerke = 100; } @Override diff --git a/src/test/java/device/radioPlayer/RadioPlayerTest.java b/src/test/java/device/radioPlayer/RadioPlayerTest.java index 6952005..e5ba0fc 100644 --- a/src/test/java/device/radioPlayer/RadioPlayerTest.java +++ b/src/test/java/device/radioPlayer/RadioPlayerTest.java @@ -31,8 +31,8 @@ class RadioPlayerTest { rp2.setLautstaerke(100); rp2.louder(); 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) ); }