Browse Source

changed from getLautstaerke() to getVolume() like it is defined in device interface

feature-pr-getVolume
Jan Ortner 3 years ago
parent
commit
1912744e55
  1. 6
      src/main/java/device/radioPlayer/RadioPlayer.java
  2. 8
      src/test/java/device/radioPlayer/RadioPlayerTest.java

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

@ -64,10 +64,6 @@ public class RadioPlayer implements Device {
Lautstaerke = lautstaerke; Lautstaerke = lautstaerke;
} }
public int getLautstaerke() {
return Lautstaerke;
}
public void changeRegion(String region){ public void changeRegion(String region){
switch (region) { switch (region) {
case "BY": case "BY":
@ -117,7 +113,7 @@ public class RadioPlayer implements Device {
} }
@Override @Override
public int getVolume() { public int getVolume() {
return 0;
return Lautstaerke;
} }
@Override @Override

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

@ -19,7 +19,7 @@ class RadioPlayerTest {
@ParameterizedTest @ParameterizedTest
@MethodSource("quieterLouderOptions") @MethodSource("quieterLouderOptions")
void quieterLouderTest(String testName, RadioPlayer testRp, int expectedResult) { void quieterLouderTest(String testName, RadioPlayer testRp, int expectedResult) {
int volume = testRp.getLautstaerke();
int volume = testRp.getVolume();
assertThat(volume).describedAs(testName).isEqualTo(expectedResult); assertThat(volume).describedAs(testName).isEqualTo(expectedResult);
} }
@ -67,12 +67,6 @@ class RadioPlayerTest {
} }
/*
@Test
void getVolume() {
}
*/
@ParameterizedTest @ParameterizedTest
@MethodSource("prevNextOptions") @MethodSource("prevNextOptions")
void prevNextTest(String testName, RadioPlayer testRp, String expectedResult) { void prevNextTest(String testName, RadioPlayer testRp, String expectedResult) {

Loading…
Cancel
Save