Browse Source

added test case for unmute() & and added productive code for RadioPlayer

feature-pr-RadioPlayer-mute
Jan Ortner 3 years ago
parent
commit
de82f475dd
  1. 3
      src/main/java/device/radioPlayer/RadioPlayer.java
  2. 8
      src/test/java/device/radioPlayer/RadioPlayerTest.java

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

@ -201,7 +201,8 @@ public class RadioPlayer implements Device {
@Override
public String unmute() {
return null;
setLautstaerke(savedVolume);
return ("RadioPlayer is unmuted Volume is set to " + getVolume());
}

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

@ -365,4 +365,12 @@ class RadioPlayerTest {
Arguments.of("Test for mute RadioPlayer if volume is saved before muting", "saved", rp1, 30)
);
}
@Test
void TestUnmute() {
RadioPlayer rp = new RadioPlayer();
rp.setLautstaerke(40);
rp.mute();
rp.unmute();
assertThat(rp.getVolume()).describedAs("Test if unmute is setting the saved volume").isEqualTo(rp.savedVolume);
}
}
Loading…
Cancel
Save