Browse Source

update the set of the Lautstaerke in the UsbPlayer class

pull/1/head
sahar 3 years ago
parent
commit
7e82d3206f
  1. 20
      src/main/java/device/UsbPlayer.java
  2. 5
      src/test/java/device/UsbPlayerTest.java

20
src/main/java/device/UsbPlayer.java

@ -1,16 +1,18 @@
package device; package device;
public class UsbPlayer implements Device{
public class UsbPlayer implements Device {
private int Lautstaerke=0;
private int Lautstaerke = 0;
public void setLautstaerke(int ls){
if(Lautstaerke < 100) {
Lautstaerke += 1;
} else {
Lautstaerke = 100;
} }
public int getLautstaerke(){return Lautstaerke;}
public void setLautstaerke(int ls) {
if (ls <= 100) {
Lautstaerke = ls;
}
}
public int getLautstaerke() {
return Lautstaerke;
}
@Override @Override
public void louder() { public void louder() {

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

@ -8,11 +8,12 @@ class UsbPlayerTest {
UsbPlayer up =new UsbPlayer(); UsbPlayer up =new UsbPlayer();
/*
@Test @Test
void louder() { void louder() {
up.setLautstaerke(1);
} }
/*
@Test @Test
void quiter() { void quiter() {
} }

Loading…
Cancel
Save