Browse Source

implement the set and get of the Lautstaerke in the UsbPlayer class

pull/1/head
sahar 3 years ago
parent
commit
4e47dec09b
  1. 10
      src/main/java/device/UsbPlayer.java
  2. 2
      src/test/java/device/UsbPlayerTest.java

10
src/main/java/device/UsbPlayer.java

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

2
src/test/java/device/UsbPlayerTest.java

@ -6,6 +6,8 @@ import static org.junit.jupiter.api.Assertions.*;
class UsbPlayerTest { class UsbPlayerTest {
UsbPlayer up =new UsbPlayer();
/* /*
@Test @Test
void louder() { void louder() {

Loading…
Cancel
Save